Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

cant compile  RSS feed

 
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
Sheriff
Posts: 10880
158
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac 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
Boost this thread!