Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

creating .class file in Tomcat

 
deepak borole
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi I am trying to compile a servlet program.I tried to set the path for java & apache by running this batch file:
-----------------------------------------------------------------
set path=%path%=;C:\Program Files\Java\jdk1.5.0\bin;C:\Program Files\Apache Group\Tomcat 4.1\bin
set classpath=%classpath%=;C:\Program Files\Java\jdk1.5.0\lib;C:\Program Files\Apache Group\Tomcat 4.1\lib\tools.jar
-----------------------------------------------------------------
I can execute javac command from DOS prompt,but when i compile my program

javac hitCountServlet.java

it cannot find javax servlet packages & hence doesnot compile.

I have tried using J2EE & using corresponding batch file.It compiles & executes in J2EE
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You also need to add servlet-api.jar to your CLASSPATH.
It's located in tomcat/common/lib.
In that version of Tomcat, it may be called "servlet.jar".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic