Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cant compile

 
sherrie blaylock
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javac -classpath /your path/tomcat/common/lib/ servlet-api-jar -d classes src/Ch1Servlet.java

this command is supposed to compile a java file and place the create class file in the src path but it is not there
trying to learn the headfirst servlets & jsp book and am stuck very early on with this not working

also, i dont know how to set the environment variables or if they are right
please ehlp
 
Junilu Lacar
Bartender
Pie
Posts: 7465
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sherrie,

I assume you are replacing "your path" with the actual path to tomcat, right?

the "-d classes" in your command actually puts the class file in the classes directory, not the src directory.

In DOS, you can set the CLASSPATH environment variable with the SET command:

C:\> set CLASSPATH=.;c:/project1/src;c:/tomcat/common/lib/servlet-api.jar;

If you want this to be in effect everytime you open a DOS command window, you would right click on "My Computer", select "Properties", click on the Advanced tab, then click on the Environment Variables button. Then add the CLASSPATH to the System Variables.
[ November 17, 2004: Message edited by: Junilu Lacar ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic