• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Newbie's questions on Tomcat

 
Yuelong Dai
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. I've added "C:\jakarta-tomcat-5.0.12\common\lib\servlet-api.jar" to my classpath, but still got "package javax.servlet does not exist" error when I tried to compile a servlet.
2. All the examples from Tomcat work, but the examples from chapter01 of "Study Kit" book don't. I got "Http 404 requested resource is not available" error.
Can anyone provide some help? Thanks.
 
cyril vidal
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For your first question, I has the same problem, and so decided to add:
c:\tomcat\common\lib\servlet.jar
to my classpath, and all is OK now.
Regards,
Cyril.
 
Yuelong Dai
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Cyril. So I added "servlet.jar" to my classpath, and it still doesn't work. And I don't understand why it would, because there's no such a file in that folder. Any thoughts?
 
rajakumar babu
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could always add "Tomcat x.x\common\lib\servlet.jar" to your Env. classpath variable or while compiling servlet, just add the above jar to the existing classpath and compile
Hope this helps.
 
Denny Permana
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Babu means, when you compile the servlet, you can add the option -classpath <classpath> before java file like this :
c>javac -classpath c:\tomcat4.1\common\lib\servlet.jar servlet_ex.java
Hope this help you.
regards.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic