This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Servlets and the fly likes javaee.jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "javaee.jar" Watch "javaee.jar" New topic
Author

javaee.jar

Michael Eller
Ranch Hand

Joined: Feb 28, 2004
Posts: 32
Do I need to have java ee sdk installed to use javaee.jar or can I get it seperately and place it in my path?
I am creating servlets but they won't compile because they cannot find the imported class javax.servlet, etc.

Thanks,
Mike
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You normally get this from your servlet container. Which are you using?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
You don't need the JEE SDK, nor the javaee.jar file to develop servlets. All jar files you need come with whatever servlet container you're using. E.g., with Tomcat, look in the common/lib directory for files called servlet-api.jar and jsp-api.jar. (The latter is needed only if you're developing JSP tag libraries, not for servlets or servlet filters.)


Ping & DNS - updated with new look and Ping home screen widget
Michael Eller
Ranch Hand

Joined: Feb 28, 2004
Posts: 32
Strange.

I am using Tomcat5 on Fedora 11 as a development environment.
When I tried to compile a servlet...I got the error stating that the imported java class javax.servlet, etc could not be found.
I searched the net for this error...and discovered that I would get this if I did not have (for my version) javaee.jar
I tried compiling from both the Tomcat location and just my home projects folder...both with the same results.
I looked all over tomcat for the javaee.jar file...not there.

Would anything else trigger this?

v/r
Mike
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
Re-read my previous post. It mentions the name(s) of the files you should be looking for.
Michael Eller
Ranch Hand

Joined: Feb 28, 2004
Posts: 32
I had to wait to get home before I could check for the jars.

I have [servlet].jar and [jsp].jar files but no servlet-api.jar or jsp-api.jar files.

Can I install them or is there some other process that needs to be done? Or should these work?

If I try to compile a java class that imports javax.servlet.*...I get the error "package javax.servlet does not exist"

Thanks,
Mike
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

Let us know what happens when you try those files.

Do you not know how to open a jar and inspect its content?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Michael Eller
Ranch Hand

Joined: Feb 28, 2004
Posts: 32
No Luck.

I went to the package installer (Fedora 11).
I found some files that seem to contain the jars needed.
I installed them...but they did not get put in the tomcat5 common lib folder.
Instead, I found them here /usr/share/java

The files are tomcat5-servlet-2.4-api.jar and tomcat5-jsp-2.0-api.jar

I put this location in my classpath

Still no luck compiling

I will keep digging!

Thanks,
Mike
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

Tomcat will already have the jar files unless you removed them for some reason.

You're making this a lot more complicated than it needs to be.
Michael Eller
Ranch Hand

Joined: Feb 28, 2004
Posts: 32
OK,

I re-did the entry into the classpath...including the .jar files themselves in the path...and that did the trick.
I can now compile servlets.

Thanks to all for the patience and recommendations.

You can all take the rest of the night off. See ya all tomorrow...bright and early!

v/r
Mike
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javaee.jar
 
Similar Threads
Doubt about @EJB in JBOSS
EJB Annotation
Deployment Issues with JSF 1.2.9, Tomcat 6.0.29 and MyEclipse 8.6
javaee.jar and Tomcat
EJB classpath issues