aspose file tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes compiler error - package javax.servlet does not exists Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "compiler error - package javax.servlet does not exists" Watch "compiler error - package javax.servlet does not exists" New topic
Author

compiler error - package javax.servlet does not exists

Varalakshmi Ramanarayan
Ranch Hand

Joined: Oct 28, 2007
Posts: 108
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.


SCJP 5 - 87%<br />Next SCWCD
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14669
    
  11

Replace colons by semi-colons at the command line :
-classpath %TOMCAT_HOME%\common\lib\servlet-api.jar;classes;.


[My Blog]
All roads lead to JavaRanch
Varalakshmi Ramanarayan
Ranch Hand

Joined: Oct 28, 2007
Posts: 108
Thanks very much Christophe..
It worked..
How could I overlook that..
Lowera Chris
Greenhorn

Joined: Jul 10, 2008
Posts: 10
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

Joined: Jul 17, 2008
Posts: 1
I tried replacing the colons with semicolons, but I am still getting the same error message.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14669
    
  11

Please show us your command line. Did you set the TOMCAT_HOME variable (type echo %TOMCAT_HOME%)?
Avani Joshi
Greenhorn

Joined: Jul 09, 2007
Posts: 13
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

Joined: Nov 24, 2005
Posts: 14669
    
  11

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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: compiler error - package javax.servlet does not exists
 
Similar Threads
Command line arguments
Servlet Compilation Error
Servlet Compilation Error
Problem running first servlet
compile errors