• 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

package class path problem

 
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well i saved class file of servlet in the
c:\tomcat2\webapps\examples\web-inf\classes\filename.java
i set path :
set classpath=c:\tomcat2\lib\servlet.jar//this work fine
when i make package pk and saved in classes folder
can anybody please tell the classpath of it.
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did not quiet understand your problem, but here is some
information that you may use:
In the tomcat server, when you develop your classes and you want to make them available to the web application , you have 2 coices.
1:- to make these classes available to a certain web application.
if you wanna do so , place the classes packed on classes directory under the web-inf directorey of your web application , or put them on a Jar file and place it on the lib directory under the web-inf directory of your web application.
2:- To make the classes available to all of the web applications deployed on the tomcat server , place them packed under $CATALINA_HOME/classes, or put them on a jar file and place them on $CATALINA_HOME/lib.
You don't have to define any class path for the tomcat , because it has it's own ones.
bye.
 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hello Jawaad Mohd,
If you use pk as package name, compile with -d option.
it will create a class file with inside pk dir., right?
copy this dir into server's class path and restart the server.
Then whenever you access the file you should give packagename.ClassName
e.g. pk.ClassName
Cheers

 
This cake looks terrible, but it tastes great! Now take a bite out of this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic