Get your CodeRanch badge!*
The moose likes Beginning Java and the fly likes cant compile Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "cant compile" Watch "cant compile" New topic
Author

cant compile

sherrie blaylock
Greenhorn

Joined: Nov 17, 2004
Posts: 3
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

Joined: Feb 26, 2001
Posts: 4419
    
    5

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 ]

Junilu - [How to Ask Questions] [How to Answer Questions]
 
 
subject: cant compile
 
Similar Threads
log4j
Problem in creating a automatic build using java , batch(.bat) file .
Javac error
Java on 32 Bit Windows?
Adding images to Jar Files (NetBeans)