This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet Compilation Error

 
karthik saivarma
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to Java.I have a problem when compiling a servlet.It gives error that
C:\j2sdk1.4.2_10\bin>javac HelloWorld.java
HelloWorld.java:2: package javax.servlet does not exist
import javax.servlet.*;
^
HelloWorld.java:3: package javax.servlet.http does not exist
import javax.servlet.http.*;

Here I have placed simple servlet HelloWorld in bin dir of j2sdk1.4.2_10 and trying to compile it frm there

I have jakarta-tomcat-5.5.9-preconfigured ,j2sdk1.4.2_10 on my windows XP system.And my classpath variables are

CATALINA_HOME - C:\jakarta-tomcat-5.5.9-preconfigured\jakarta-tomcat-5.5.9
JAVA_HOME -C:\j2sdk1.4.2_10
PATH -%USERPROFILE%\Local Settings\Temp;$JAVA_HOME\bin;$JAVA_HOME\lib;$CATALINA_HOME\common\lib\servlet-api.jar;$CATALINA_HOME\common\lib\jsp-api.jar

TEMP -%USERPROFILE%\Local Settings\Temp;$JAVA_HOME\bin;$JAVA_HOME\lib;$CATALINA_HOME\common\lib\servlet-api.jar;$CATALINA_HOME\common\lib\jsp-api.jar

TMP -%USERPROFILE%\Local Settings\Temp

Actually I downloaded jakarta preconfigured version where the dir structure is like this
jakarta-tomcat-5.5.9-preconfigured\tomcat-5.5.9\common\lib\servlet-api.jar

I have even tried setting classpath at command prompt by giving
c:\ set classpath =%classpath%jakarta-tomcat-5.5.9-preconfigured\tomcat-5.5.9\common\lib\servlet-api.jar


But still compiler is givig the error that servlet packages are not found..I am not able to figure out where the problem would be.Please some one help me reg this..

Thanks
Karthik
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65537
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please see the Servlet FAQ. It's link can be found at the top of the Servlets forum listing.
 
Humans and their filthy friendship brings nothing but trouble. My only solace is this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!