• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem compiling a simple servlet - newbie

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic