This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Problem compiling a simple servlet - newbie Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem compiling a simple servlet - newbie" Watch "Problem compiling a simple servlet - newbie" New topic
Author

Problem compiling a simple servlet - newbie

Charu Krishnan
Greenhorn

Joined: Oct 24, 2000
Posts: 19
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

Joined: Dec 02, 2001
Posts: 72
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

Joined: Oct 24, 2000
Posts: 19
Thanks a ton Venkat. I have been breaking my head for two days over this and finally it is resolved
Many thanks
Charu
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem compiling a simple servlet - newbie
 
Similar Threads
Problem running first servlet
Setting classpath and compiling HELP!
compiling command: servlet-api.jar:classes: . ?
william, help needed
problems compiling servlets