Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Package fustration

 
Rik Abel
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This sounds like a classpath problem - have you checked that your classpath includes the package in question?
 
Rik Abel
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic