File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes My First Servlet!!!  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "My First Servlet!!!  " Watch "My First Servlet!!!  " New topic

My First Servlet!!!

Jon Davies

Joined: Nov 21, 2003
Posts: 6
Hi All,
This is probably more of a DOS query than anything, but... I have copied the .java file into the following directory: jwsdp-1.3/webapps/myapps/WEB-INF/classes but I cannot compile it. (jwsdp-1.3 has Tomcat running).
I have changing the command line to the classes directory and then compiling with the following command:
javac-classpath C:jwsdp-1.3\common\lib\servlet.jar
but I get the following error message:
'javac-classpath' is not recognised as an internal or external command, operable program or batch file.
I have also changed the CLASSPATH environmental variable to point to the Servlet.jar file in common\lib and then complied with the following:
but I get much the same error message.
All of my programming thus far has been applets and applications and I have always used a text editor to compile. Please help! I'm using XP Pro if that makes any difference. Is it possible to use a text editor to compile servlets???
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

The first error is because "javac" is a separate word; there ought to be a space between "javac" and "-classpath." If you've got a similar error from the second command line, then that means the JDK isn't on your path. You need to go into the System control panel (or whatever they've decided to call it this year) and add C:\jdk1.4.2_03\bin to your PATH environment variable. Substitute the correct path to your own particular installation of the JDK if it's different than this. After doing this, you need to open a new command window in which the new settings will have taken effect; close the old one, it won't know about the new PATH.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: My First Servlet!!!
It's not a secret anymore!