dcsimg
Trouble compiling - can't find javax.servlet.*
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Wednesday, January 16, 2002 12:41 PM

Admittedly, this is a real newbie question, but I can't seem to find the answer anywhere.. I'm trying to compile a simple example JavaBean from the "Deploying Web Applications to Tomcat" tutorial on the OnJava site. I get a bunch of errors related to the compiler being unable to find javax.servlet.* and javax.servlet.http.*, which I'm importing. I went and downloaded the servlet class files, and unzipped them, but I'm not sure I've set them up correctly. I put them in c:javasrcjavaxservlets. (c:java being my jdk directory.) Is there a problem with their location, or do I need to modify some file or variable to tell the Java compiler where they are? Thank you, Garann    More>>

Admittedly, this is a real newbie question, but I can't seem to find the answer anywhere..



I'm trying to compile a simple example JavaBean from the "Deploying Web Applications to Tomcat" tutorial on the OnJava site. I get a bunch of errors related to the compiler being unable to find javax.servlet.* and javax.servlet.http.*, which I'm importing.



I went and downloaded the servlet class files, and unzipped them, but I'm not sure I've set them up correctly. I put them in c:javasrcjavaxservlets. (c:java being my jdk directory.) Is there a problem with their location, or do I need to modify some file or variable to tell the Java compiler where they are?



Thank you,
Garann

   <<Less

Re: Trouble compiling - can't find javax.servlet.*

Posted By:   Jonathan_Downey  
Posted On:   Thursday, January 17, 2002 01:45 AM

The easiest way to fix this is to append %TOMCAT_HOME%libservlet.jar to the classpath, assuming that %TOMCAT_HOME% is set to your Tomcat folder.

Re: Trouble compiling - can't find javax.servlet.*

Posted By:   Anonymous  
Posted On:   Thursday, January 17, 2002 01:35 AM

It's a CLASSPATH problem. You need to add the servlet classes (better if you get the servlet.jar file) in the classpath of your compiler or your IDE.


Regards

About | Sitemap | Contact