• 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
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

Compiling a servlet

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having a problem compiling the hello world sample servlet.
I getting an error whenever I try to compile the java file. For one reason or another I'm getting an error stating that the javax.servlet.*; package does not exist. I've tried compiling it in TextPad,the command line, and in JBuilder but no luck. Also I've tried running a servlet that came with Tomcat and it works just fine, so I tried to compile the java file and that also failed. Can anyone help or point me in the right direction. Thanks
 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, the first thing I can think of is classpath. When u use JBuilder, either add where tomcat servlet.jar in u project library. Or edit u autoexec.bat to include the jar file.
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when the compiler can't find a package, most times
it has to do with your classpath and not the editor.
having said that, whats' your classpath?
you should have added %TOMCAT_HOME%\lib\servlet.jar
to your classpath and then compile the servlet.
hth....
regds.
- satya

OOPS.....i din't know i was competing with you Cinthia....

[This message has been edited by Madhav Lakkapragada (edited February 01, 2001).]
 
wayne drummond
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the help I figured as much. I've been tinkering with my classpath and I'm not sure if it is correct, however here is a copy of what I have.
E:\Oracle\Ora81\orb\classes\yoj.jar;E:\Oracle\Ora81\orb\classes\share.zip;C:\jdk1.3\bin;C:\JAVA;C:\Java\JavaRanchCommon.zip;C:\jakarta-tomcat-3-2-1\lib\servlet.jar;C:\jakarta-tomca t-3-2-1\lib\jasper.jar;c:\java\jakarta-servletapi-3.2.zip;C:\jakarta-tomcat-3-2-1\lib;c:\jdk1.3\lib\tools.jar
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
E:\Oracle\Ora81\orb\classes\yoj.jar;E:\Oracle\Ora81\orb\classes\share.zip;C:\jdk1.3\bin;C:\JAVA;C:\Java\JavaRanchCommon.zip;C:\jakarta-tomcat-3-2-1\lib\servlet.jar;C:\jakarta-to mcat-3-2-1\lib\jasper.jar;c:\java\jakarta-servletapi-3.2.zip;C:\jakarta-tomcat-3-2-1\lib;c:\jdk1.3\lib\tools.jar
IMO, I would limit it to have the bare minimum....something like this:
E:\Oracle\Ora81\orb\classes\yoj.jar;E:\Oracle\Ora81\orb\classes\share.zip;C:\jakarta-tomcat-3-2-1\lib\servlet.jar;C:\jakarta-tomca
t-3-2-1\lib\jasper.jar;C:\jdk1.3\lib\tools.jar
Also make sure that tomcat_home is C:\jakarta-tomcat-3-2-1
Somehow, till know I have seen something like C:\jakarta-tomcat-3.2.1
Pl. check with your system.

Regds.
- satya
 
If you like strawberry rhubarb pie, try blueberry rhubarb (bluebarb) pie. And try this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic