Forums Register Login

How to Install/extract JEE libraries?

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 586 times.
Similar Threads
How to set up a Java EE development environment
"Source not found." and the src.zip
Installing Java EE 6 on Ubuntu/linux
Unable to install JavaEE 6
Install JavaEE 7: How to? No RPM? How to install from the only ZIP: java_ee_sdk-7u1.zip
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:52:24.