• Post Reply Bookmark Topic Watch Topic
  • New Topic

reg deployment on tomcat

magesh sripathy
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

i have a basic doubt of how to deploy the servlet in tomcat....

i have a servlet name sample.java in the folder structure
jdk 1.5/bin/com/example/web/sample.java..i need to compile this and i need to place the class files under the folder tomcat/webapps/sam/com/example/web ..
how i can do this....

when i compile this as below

d:/jdk1.5/bin> javac com/example/web/sample.java

it throws the numerous compile error like package javax.servlet and javax.servlet.http cannot be found ..please guide me as i am very new to servlet..


Gaurav Gambhir
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems to be a classpath problem
set the classpath i.e
CATALINA_HOME it refers to tomcat installation directory
and JAVA_HOME refers to JDK installation directory

so in Environment variable set (ControlPanel--System�Advance-- Environment variables)

Variable_Value C:\jakarta-tomcat-5

Variable_Name JAVA_HOME
Variable_Value C:\jdk1.5

In classpath
Variable_Name classpath
Variable_Value C:\jakarta-tomcat-5\common\lib\servlet-api.jar;C:\jakarta-tomcat 5\common\lib\jsp-api.jar;

In Tomcat 4 that is servlet.jar and in Tomcat 5 its servlet-api.jar--check that in lib folder

After doing all this now try again compiling your program

Make sure while compiling if you are importing some packages like com.example.web then follow the directory structure acordingly.
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!