aspose file tools*
The moose likes Servlets and the fly likes HelloWorld Servlet compilation errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "HelloWorld Servlet compilation errors" Watch "HelloWorld Servlet compilation errors" New topic
Author

HelloWorld Servlet compilation errors

pradeep bommakanti
Greenhorn

Joined: Mar 29, 2005
Posts: 5
Hi Friends,
I am new to work with Servlets. I wrote a small Servlet program to print "HelloWorld" but its giving compilation errors like:

package javax.servlet does not exist
package javax.servlet.http does not exist ...

I am using jdk1.3.1_08. can anyone tell me the reason[s].
Thanks in advance

- Pradeep

here is the code:

Abhinay Verma
Greenhorn

Joined: Dec 13, 2004
Posts: 24
Do you have J2EE on your machine?
pradeep bommakanti
Greenhorn

Joined: Mar 29, 2005
Posts: 5
Hello Abhinay,
After I set the classpath [tomcat\lib\common\servlet.jar] the Servlet file compiled successfylly.
Thanks
-Pradeep
Kiran Sonaje
Greenhorn

Joined: Aug 23, 2004
Posts: 23
Just put your servlet.jar into your jdk's jre\lib\ext directory.
James Carman
Ranch Hand

Joined: Feb 20, 2001
Posts: 580
Originally posted by Kiran Sonaje:
Just put your servlet.jar into your jdk's jre\lib\ext directory.


Bad idea! What if they want to run another container which uses a different version of the servlet API using the same JRE?


James Carman, President<br />Carman Consulting, Inc.
Neeraj Dheer
Ranch Hand

Joined: Mar 30, 2005
Posts: 225
the jar file file will be under the $TOMCAT_HOME/common/lib directory.

But the jar file name will be either servlet.jar or servlet-api.jar depending on tomcat version.

For downloading the latest servlet version or specification :

http://java.sun.com/products/servlet/download.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HelloWorld Servlet compilation errors