aspose file tools*
The moose likes Beginning Java and the fly likes Can't see other classes inside package?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Can Watch "Can New topic
Author

Can't see other classes inside package??

Scott Farran
Greenhorn

Joined: Mar 10, 2002
Posts: 9
Hi-
Thanks in advance for the help here. I have a web app with a number of classes in a package. I can instantiate a new object (system classes) from any of these classes no problem assuming I use the appropriate import statements. The problem arises when I try to create an object from one of the classes in the same package. It can't see them. I'm able to do it from my JSP pages calling the exact same classes, they just can't see each other from inside the package. Does the package need to be added to the classpath? and if it does then why do my jsp pages have no problem seeing the classes? I am running Tomcat 4.0. Is there a setting that needs to be set in the web.xml? I am a little mystified.
Scott Farran
SCJP
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
This does sound like a CLASSPATH/import issue.
I can instantiate a new object (system classes) from any of these classes no problem assuming I use the appropriate import statements.
What does this mean? What is system classes?
If your classes are defined to be in some package, then you do need to import them or fully qualify the class locations when you use them. And the parent directory of the package folder structure does need to be locatable in the CLASSPATH setting (and by the application server).
[ June 21, 2003: Message edited by: Dirk Schreckmann ]

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
tapasvi vaishnav
Greenhorn

Joined: Jun 22, 2003
Posts: 3
Hi scott :
please check whether current directory is there in your %CLASSPATH% .
 
Consider Paul's rocket mass heater.
 
subject: Can't see other classes inside package??