File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes package class path problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "package class path problem" Watch "package class path problem" New topic

package class path problem

jawwad ahmed
Ranch Hand

Joined: Dec 01, 2001
Posts: 179
Well i saved class file of servlet in the
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.
maher dabbas

Joined: Dec 02, 2001
Posts: 26
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.
Sarath Mohan
Ranch Hand

Joined: Mar 17, 2001
Posts: 213

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

Sarath Mohan
I agree. Here's the link:
subject: package class path problem
It's not a secret anymore!