This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes unable to compile servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "unable to compile servlet" Watch "unable to compile servlet" New topic
Author

unable to compile servlet

billy williams
Greenhorn

Joined: Sep 02, 2009
Posts: 4
hello everyone ,
i am new to javaranch .

i have a error when is compiled the servlet file , mentioned below --


i got six errors , but i have tomcat

Pulkit Dave
Greenhorn

Joined: Sep 02, 2009
Posts: 1
hi

javax.servlet.*;
and
javax.servlet.http.*;

packages are in a jar file.. "servlet-api.jar"
you have to set your classpath to it...

rest is fine
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41034
    
  43
The "servlet-api.jar" file needs to be in the classpath. You can find it in the common/lib directory of your Tomcat installation.


Ping & DNS - my free Android networking tools app
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3816

Ulf Dittmer wrote:... You can find it in the common/lib directory of your Tomcat installation.


In tomcat 6 it's directly inside "lib" no "common" folder.

SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

There's also a FAQ about this.


[My Blog]
All roads lead to JavaRanch
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37879
    
  22
And welcome to the Ranch, Pulkit Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unable to compile servlet
 
Similar Threads
javac problems
How To Compile Servlet
Unable to import
Newbie with servlets and JBoss
Why can't use javac to compile servlet?