• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to Install/extract JEE libraries?  RSS feed

 
Laurent Algidd
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I'm trying to make my first servlet, however since I have only installed the Java SE, the javac compiler is complaining about missing packages (javax.servlet.http...)

I've realized now that I need javax.servlet jar or class files from Java EE, but after downloading java_ee_sdk-7u1.zip from Oracle here I'm not seeing any .sh or java_ee_sdk-7-jdk7-macosx-x64.sh
installer (which I saw mentioned elsewhere). The oracle page only instructs to unzip the downloaded file, and searching for javax.servlet only reveals a few files which I'm not sure what to do with:

javax.servlet-api.jar,
javax.servlet.jsp.jar,
javax.servlet.jsp-api.jar,
javax.servlet.jsp.jstl.jar,
javax.servlet.jsp.jstl-api.jar,
javax.servlet.ServletContainerInitializer,

How do I go about installing the Java EE libraries I need? I am on a mac, and I'd like to do this without the help of an IDE, using the command prompt if necessary.

I would appreciate any tips
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37496
540
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Laurent,
Welcome to CodeRanch!

javax.servlet-api.jar likely contains the classes you need to compile so you can add them to your classpath at compile time.

Once you compile, you'll need to build a war. (A zip file in a certain format). Then you'll need to deploy it somewhere. I recommend downloading Tomcat so you can test locally.
 
Laurent Algidd
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help! I was able to add javax.servlet-api.jar to the javac compiler command as you suggested and I compiled successfully!

I think I had expected to reference class files individually, such as javax.servlet.http.HttpServletRequest...etc since I have not dealt with .jar files before.

I have now successfully deployed using Tomcat and next I will look into how .war packages are created. Thanks again
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!