aspose file tools*
The moose likes Servlets and the fly likes linux servlet class path compile help 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 "linux servlet class path compile help" Watch "linux servlet class path compile help" New topic
Author

linux servlet class path compile help

Tom Reese
Greenhorn

Joined: Apr 24, 2011
Posts: 12
Hi everyone,
I hate to start a new thread but I have not been able to find a solution to my problem. I am currently messing around with aws ec2 servers with suselinux environment. I am trying to deploy a web app but I am unable to because of my web-app cannot see the servlet-api.jar library. How do I set the class path permanently or temporarily so that I the web-app knows how to use servlets?
I have done a bit of digging around and one solution was to use the java -classpath command, which I never got to work, I also know that you can type set CLASSPATH=/usr/share/java/servlet-api.jar I am not sure how to get this to work either because everytime I tried to compile my java files they would still not compile even after trying this. I am feeling really lost on how to go about doing this. Any input would greatly help me, thanks!
-Tom R

nevermind just needed a more in depth guide http://www.yolinux.com/TUTORIALS/LinuxTutorialTomcat.html
Prashant Saraf
Ranch Hand

Joined: Sep 25, 2006
Posts: 52

One solution you can try is put your jar files in lib folder of web-app, the address should be webapp/web-inf/lib.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

Prashant Saraf wrote:One solution you can try is put your jar files in lib folder of web-app

NO! Putting servlet-api.jar in a web app's lib folder is 100% guaranteed to cause no end of messed up issues! Never, ever, do that!

Tomcat should have a copy in its own lib folder and that's where it should stay.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Tom Reese
Greenhorn

Joined: Apr 24, 2011
Posts: 12
Thanks for the responses, always seem to be learning something new all the time.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: linux servlet class path compile help
 
Similar Threads
Problem in setting CLASSPATH
How to set Servlet classpath in Tomcat temporarily?
servlet compilation error.
javax.servlet not found
Cannot resolve symbol