aspose file tools*
The moose likes Beginning Java and the fly likes Package fustration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Package fustration" Watch "Package fustration" New topic
Author

Package fustration

Rik Abel
Greenhorn

Joined: Nov 24, 2003
Posts: 7
I need help with packages.

I totally understand the whole point of importing, but what can you do if you get "package ... does not exist" when you are importing a package that you think does exist?

Is there a command or check you can run to see if a package has been created or exists?

This is frustrating because I'm copying examples out of the Head first Servlets and JSP book, have done everything as required (Page 85 of book) when it comes to importing a package called com.example.model.*; I get told this package doesn't exist! but the directory does exist, with the file which needs to be imported, so I'm assuming the package should.



So if I know the directory exists, how can I debug this problem?

Any help/suggestions would be much appreciated.
Horatio Westock
Ranch Hand

Joined: Feb 23, 2005
Posts: 221
This sounds like a classpath problem - have you checked that your classpath includes the package in question?
Rik Abel
Greenhorn

Joined: Nov 24, 2003
Posts: 7
Cheers, it was a classpath issue alright.

Read some stuff about how multiple classpaths can be set, seperate them with a ';' (in Windows).

This link was useful to me:

http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/classpath.html

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Package fustration