aspose file tools*
The moose likes Tomcat and the fly likes J2EE question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "J2EE question" Watch "J2EE question" New topic
Author

J2EE question

B Wiley Snyder
Ranch Hand

Joined: Nov 26, 2003
Posts: 50
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 ]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
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

Joined: Nov 26, 2003
Posts: 50
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?
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

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.
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
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

Joined: Nov 26, 2003
Posts: 50
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: J2EE question