aspose file tools*
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
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: 14688
    
  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: 14688
    
  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: 14688
    
  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