wood burning stoves 2.0*
The moose likes Servlets and the fly likes problem with compiling servlets 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 » Servlets
Bookmark "problem with compiling servlets" Watch "problem with compiling servlets" New topic
Author

problem with compiling servlets

Ravi Kotha
Ranch Hand

Joined: Mar 02, 2006
Posts: 53
Hello everybody,

i have write a servlet...but iam unable to compile the servlet. While compilation its showing errors like "package java.servlet.http.*" does not exist. I have installed sun application server. I have set the CLASSPATH as

"C:\Sun\AppServer\jdk\lib\dt.jar;C:\Sun\AppServer\jdk\lib\tools.jar;.;"

Whats wrong with me?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

You need to add the JAR file containing the servlet api.
Search for a file called something like servlet-api.jar.

By the way, you were not preparing for SCJP ? (no servlet)
[ March 02, 2006: Message edited by: Satou kurinosuke ]

[My Blog]
All roads lead to JavaRanch
Ravi Kotha
Ranch Hand

Joined: Mar 02, 2006
Posts: 53
hello frnd,

Thanks for your response, yes iam preparing for SCJP. also for j2ee.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Maybe you should concentrate on SCJP first, and leave servlets for later
Anyway, good luck.
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
Use Tomcat web server instead of sun application server.


Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Ravi Kotha
Ranch Hand

Joined: Mar 02, 2006
Posts: 53
Hai,

I have searched for the file servlet-api.jar.. I found this file in my Netbean IDE. The path for this file is

"C:\Program Files\netbeans-5.0\enterprise2\jakarta-tomcat-5.5.9\common\lib"

shall i set the CLASSPATH to this directory?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Set
"C:\Program Files\netbeans-5.0\enterprise2\jakarta-tomcat-5.5.9\common\lib\servlet-api.jar"
to your path.
chengchuan lu
Greenhorn

Joined: Mar 02, 2006
Posts: 1
not java.servlet.http.*;
correct is javax.servlet.http.*;
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with compiling servlets
 
Similar Threads
Unable to run web application when moved from Tomcat to Jboss
package javax.ejb does not exist with sun app server 8.0
My j2ee jdk1.4.2 is not supporting javax package.
javax.servlet not found
Fix Pack not working in WAS 3.5.3