• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

J2EE question

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not understanding why I cannot compile this


If you can, how did you do it?

If I go here....
http://java.sun.com/j2se/1.4.2/docs/api/

I see classes I can compile packages to import, a way to learn the language.......

If I go here....
http://java.sun.com/j2ee/1.4/docs/api/index.html

Whats the difference ?

I don't understand why I cannot compile this code???
I can compile servlets ?
Why can't I compile j2ee ?

My J2EE HOME is set to C:\Sun\AppServer\bin
My JAVA HOME is set to C:\j2sdk1.4.2_04\bin
My PATH is set to ;;C:\j2sdk1.4.2_04\bin;C:\mysql\bin;C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib;C:\Sun\AppServer\lib

Why can't my netbeans IDE or command line see a j2ee class if it can see everyting else ? I guess thats not what I'm understanding?

thanks
[ August 29, 2004: Message edited by: B Wiley Snyder ]
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The javax.activation package is in a separate activation.jar file - perhaps your installation does not have it.
If you are just learning the language - I suggest you start with J2SE because J2EE is more complex. With J2SE and the Tomcat package you can stay busy for quite a while.
Bill
 
B Wiley Snyder
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by William Brogden:
The javax.activation package is in a separate activation.jar file - perhaps your installation does not have it.
If you are just learning the language - I suggest you start with J2SE because J2EE is more complex. With J2SE and the Tomcat package you can stay busy for quite a while.
Bill



I've been playing with j2se and tomcat for years, I'd like to learn j2ee. Even if it is baby steps thats why I'm posting.

Maybe my installation does not have the javax.activation package.

What i do have is the entire j2ee sdk??? Insert a package that would be included with that replacing my javax.activation package and I see if you can compile it, if not, tell me how I can compile it. Where do I need to place the .jar files whats going on??

PLEASE can someone answer my questions?
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
look in tomcat's common/lib directory. You should find activation.jar and mail.jar. These are the jar files you need to *compile* anything with JavaMail. They are in common/lib, because Tomcat needs them when you *run* anything with JavaMail.

The "entire j2ee sdk" would also have these files (well, the classes in them).

If your trouble is related to compiling a java source file, then brush up on using the -classpath parameter of javac. You just have to have activation.jar and mail.jar on your classpath. Leave them where they are in common/lib, and Tomcat will be able to find them when it needs them for your compiled classes.
 
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, so you know that, generally speaking, to compile something the JARs you need have to be in your classpath, right? So are you saying that you've put all the JARs that came with the J2EE installation in your classpath? Doesn't sound like a great idea - you should really only include the ones you need for your current app or project (to avoid headaches).

If you haven't put all the JARs in your classpath (or the right one) that will be your problem. Are you familiar with how to set the classpath in the Netbeans IDE? You have to mount any JARs you need to use in your project.

javax.activation is a standard part of the J2EE distribution so you should have it in your installation.

Hope this helps with your problem.

Jules
 
B Wiley Snyder
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Julian Kennedy:
OK, so you know that, generally speaking, to compile something the JARs you need have to be in your classpath, right? So are you saying that you've put all the JARs that came with the J2EE installation in your classpath? Doesn't sound like a great idea - you should really only include the ones you need for your current app or project (to avoid headaches).

If you haven't put all the JARs in your classpath (or the right one) that will be your problem. Are you familiar with how to set the classpath in the Netbeans IDE? You have to mount any JARs you need to use in your project.

javax.activation is a standard part of the J2EE distribution so you should have it in your installation.

Hope this helps with your problem.

Jules



I guess I'm just not familiar with how to set the classpath in netbeans becuase it compiles my servlets just fine? So I assumed what I set in my environmental variables on the os was enough. I just mounted C:\Sun\AppServer\bin and everything compiles fine now in netbeans. It's just when I was using PCGRASP I had to type in a classpath var for servlets jar and I dont in netbeans, I don't know I'm getting there thank you to everyone.

-regards
-Wiley
 
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic