• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

My First Servlet!!!

 
Jon Davies
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 TestServer.java
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:
javac TestingServlet.java
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???
TIA,
Jon
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic