LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 01-08-2009, 06:11 PM   #1
martijnburger
LQ Newbie
 
Registered: Dec 2008
Posts: 20

Rep: Reputation: 0
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.

What am I doing wrong?
 
Old 01-08-2009, 06:35 PM   #2
Mega Man X
Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 63
Quote:
Originally Posted by martijnburger View Post
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.

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:

Code:
export CLASSPATH=$CLASSPATH:/usr/share/java/tomcat6-servlet-2.5-api.jar
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.
 
Old 01-09-2009, 05:57 AM   #3
martijnburger
LQ Newbie
 
Registered: Dec 2008
Posts: 20

Original Poster
Rep: Reputation: 0
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.
 
Old 01-10-2009, 04:44 PM   #4
martijnburger
LQ Newbie
 
Registered: Dec 2008
Posts: 20

Original Poster
Rep: Reputation: 0
Solved it! I said it would be something imbarresing, and it is. I put a semicolon in my CLASSPATH instead of a colon. Thanks for the help anyway!
 
Old 01-10-2009, 05:18 PM   #5
Mega Man X
Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 63
Thumbs up

Quote:
Originally Posted by martijnburger View Post
Solved it! I said it would be something imbarresing, and it is. I put a semicolon in my CLASSPATH instead of a colon. Thanks for the help anyway!
Congratz mate. Thanks for replying to your own post by the way. It sure will help other people when looking after a solution for the same problem.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to run a servlet using tomcat me4linux Linux - Networking 0 01-28-2007 04:42 AM
Tomcat: package javax.servlet does not exist xpucto Linux - Software 0 03-21-2006 06:45 AM
install Java (Servlet), Tomcat on Fedora need help. learn Fedora 2 02-24-2004 11:28 PM
how can i run my helloworld servlet in apache-tomcat-mod_jk? doublefailure Linux - Software 1 04-28-2003 08:33 AM
system.out.println() not working in servlet, Tomcat Ethan Programming 7 07-24-2002 11:40 AM


All times are GMT -5. The time now is 08:46 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration