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

package problem...

raja srinivas
Greenhorn

Joined: Jun 22, 2001
Posts: 20
hi,
I am writing an application that has to reference another package,
my directory structure is
Directory1----->Subdirectory1------>SubsubDirectory1
----->SubDirectory2
Now i have the Directory1 in my Classpath, and my Foo.java file is in SubsubDirectory1 in which i declare its package as
package Directory1.Subdirectory1.SubsubDirectory ;
in this same file i have an import statement
import Directory1.Subdirectory2.*;
now this subdirectory contains a Boo.java file which i reference in Foo.java. The Boo.java file is also not compiled yet and it has the package statement as follows
package Directory1.Subdirectory2;
now my first question is
when i compile the Foo.java i get a compiler error saying
"package Directory1.Subdirectory2 does not exist"
can anyone solve this problem of mine ? How do i reference Boo.java in my Foo.java
Thanks
Raj
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
if Directory1 is in your classpath, then your package name should be
Subdirectory1.SubsubDirectory
The way it is the system is looking for the Directory1 directory under the classpath directory named Directory1.


"JavaRanch, where the deer and the Certified play" - David O'Meara
raja srinivas
Greenhorn

Joined: Jun 22, 2001
Posts: 20
yup it works....
thanks Cindy :-)
 
wood burning stoves
 
subject: package problem...