• 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

reg deployment on tomcat

Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..


Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
    Bookmark Topic Watch Topic
  • New Topic