Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javaee.jar

 
Michael Eller
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You normally get this from your servlet container. Which are you using?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)
 
Michael Eller
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Re-read my previous post. It mentions the name(s) of the files you should be looking for.
 
Michael Eller
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let us know what happens when you try those files.

Do you not know how to open a jar and inspect its content?
 
Michael Eller
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic