This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

compiler error - package javax.servlet does not exists

 
Varalakshmi Ramanarayan
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ranchers!!
I have just started preperation for SCWCD, with HFJS. I am in the 3rd chapter, and am trying to build the servlet app in explained in that chapter. But I am getting errors like

I have tried hours and hours finding the solution for this, but in vein. I tried to change the classpath settings, environmental variable settings. nothing worked. Can someone please let me know the cause and solution for this error?
currently, I am using Tomcat 5.5, and I have set environment variables as below(in my case)
and javac comand as below

What am I missing? hoping for help!!
Thanks a lot in advance.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Replace colons by semi-colons at the command line :
-classpath %TOMCAT_HOME%\common\lib\servlet-api.jar;classes;.
 
Varalakshmi Ramanarayan
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much Christophe..
It worked..
How could I overlook that..
 
Lowera Chris
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Goodness! I got the same problem and spent two days to try to solve the problem. Now I know colons ":" are used in Unix/Linux, but semi-colons ";" are used in Windows. The book did not tell me the difference. So I was totally confused.
Thanks a lot for helping me with the answer.

Sunny
 
Phil Washburn
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried replacing the colons with semicolons, but I am still getting the same error message.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please show us your command line. Did you set the TOMCAT_HOME variable (type echo %TOMCAT_HOME%)?
 
Avani Joshi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am also facing the same problem. I am using this command and its throwing me an expection

package javax.servlet does not exists.

javac -classpath C:\Program~\Apache~\Tomcat~\common\lib\servlet-api.jar;classes;. -d classes src\com\example\web\BeerSelect.java

Can some please tell me where I am going wrong.

Thanks in advance
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
throwing me an expection

A compilation error, not an exception

What are these "~" ? Try to enclose the whole classpath with double quotes :
javac -classpath "C:\Program~\Apache~\Tomcat~\common\lib\servlet-api.jar;classes;." -d classes src\com\example\web\BeerSelect.java
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic