• 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

problems compiling servlets

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
I use oracle server that has apache tomcat http server.
Web server works fine along with jsp and servlets.
IsItWorking servlet loads well too.
But I have a problem compiling servlets, I get an error:
HelloWorld.java:4: package javax.servlet does not exist
import javax.servlet.*;
HelloWorld.java:5: package javax.servlet.http does not exist
import javax.servlet.http.*;
I understand that it cannot find certain classes, but how then I can compile .java that imports javax.servlet.* ???
thanks
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The classes you need can be found in either j2ee.jar or servlet.jar
If you are running tomcat, servlet.jar is available in TOMCAT_HOME/common/lib
Tomcat can find it here when it needs it, but if you want to compile your servlets you'll need to add it to your classpath...
Dave.
 
joke time: What is brown and sticky? ... ... ... A stick! Use it to beat this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic