package javax.servlet does not exist on Fedora 10 / Tomcat 6
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
package javax.servlet does not exist on Fedora 10 / Tomcat 6
Hi Everyone,
I'm really imbarresed to have to ask this question because there are already al lot of threads to be found regarding the same question, however, I haven't been able to get the solutions proposed there working on my system.
My configuration is:
Fedora 10
Apache 2.2
Sun JDK 1.6
Tomcat 6
When I try to compile a simple .java I get a compiler error stating:
package javax.servlet does not exist
I've tried including /usr/share/java/tomcat6-servlet-2.5-api.jar which didn't solve the problem.
I'm really imbarresed to have to ask this question because there are already al lot of threads to be found regarding the same question, however, I haven't been able to get the solutions proposed there working on my system.
My configuration is:
Fedora 10
Apache 2.2
Sun JDK 1.6
Tomcat 6
When I try to compile a simple .java I get a compiler error stating:
package javax.servlet does not exist
I've tried including /usr/share/java/tomcat6-servlet-2.5-api.jar which didn't solve the problem.
What am I doing wrong?
The problem is that servlet.jar is not on your CLASSPATH. You will need to export it in order to get it to compile. Something like this should do:
NOTE: the above may not work, I am guessing the path only
Personally, I would not touch servlets without an IDE. With an IDE, you could simply add your jars to your project, painless, letting you, the programmer, to do what you are supposed to do: program
Just a hint
Last edited by Mega Man X; 01-08-2009 at 06:38 PM.
Thanks for the reply. I've tried including the servlet api in a CLASSPATH env variable, and in the parameters on the commandline (-classpath), I even tried copying the /usr/share/java/tomcat6-servlet-2.5-api.jar to my directory where I was compiling the java servlet. It all doesn't work
BTW: I have no CLASSPATH set at all at the moment.
BTW2: I'm running this on a old server, with no X or GNOME, let alone an IDE.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.