• 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

setting classpath, tomcat 5

 
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
as many of you may have once experienced, I'm getting errors when trying to import javax.servlet.* and such. My current classpath settings are:
.;C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\servlet-api.jar; C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\jsp-api.jar
as specified by: http://www.coreservlets.com/Apache-Tomcat-Tutorial/#Set-CLASSPATH
but, alas it still doesn't seem to be correct. The example servlets installed with Tomcat work fine, when I try to compile simple servelts, I get errors in the import, package javax.servlet does not exist.

Anyone been through this before, care to point me in the correct direction?
Thanks!
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the page you reference Note that this all goes on one line with no spaces--it is broken here only for readability
I'm slightly worried by the space in your classpath. Have you tried it woth no spaces?
If that's note the problem, have you double checked that the appropriate jar files really are where you have said.
Finally, did you quit and restart the command window after changing the CLASSPATH? - try

to see what it thinks it is
 
Michael Sullivan
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I removed the space, with no effect. The packages are in fact where I specify them. Interestingly enough, echo %CLASSPATH% returns:
%CLASSPATH%
so something is wrong, perhaps the system does not recognize the classpath as I have defined it?
 
Michael Sullivan
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Frank,
Thanks for your responses. I ended up just deleting the CLASSPATH, and recreating it. After that, it seemed to work just fine. No explanation, just one of those strange windows quirks I guess. Thanks for the assist.
Michael
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For serious work with servlets, I recommend using ANT - once you get over the learning curve you never have to mess with CLASSPATH in the environment variables again.
Bill
 
Michael Sullivan
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes, but for now... for the basic learning curve... ant will only confuse the matter. Later, Ant will come into play.
reply
    Bookmark Topic Watch Topic
  • New Topic