• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem compiling a simple servlet - newbie

 
Charu Krishnan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to servlets and just downloaded Tomcat - version 3.2.1
Since I am working on Windows 95 thought an earlier version may be better. Also working with J2EE 1.3
I set up all the environment variables and classpaths.
Now I have my test servlet under the directory c:\servlets. I am compiling it using the following command from the directory c:\servlets "javac -classpath servlet.jar;.HelloWorld.java". I get no error messages, but find no class files under this directory as expected.
If I don't specify the classpath then I get errors while compiling saying that it can't find the required libraries, so definitely when I specify the right classpath I know that it has all the libraries to compile. It is a weird problem since I don't get any error messages.
I am wondering if I need to place the file HelloWorld.java somewhere in the tomcat install_dir or is it some problem like that. Amy advice would be much appreciated.
Regards
Charu
 
Sita Kodali
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of the best ways is to copy servlet.jar from <tomcat3.2xfolder>/lib into your <jdkfolder>/jre/lib/ext. Each jar file in this folder will come into classpath without explicit %classpath% variable declaration.
You can compiel all your servlets without adding -classpath suffix
HTH
--
Venkat
 
Charu Krishnan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a ton Venkat. I have been breaking my head for two days over this and finally it is resolved
Many thanks
Charu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic