This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Unable to import package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Unable to import package" Watch "Unable to import package" New topic

Unable to import package

Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 832
I've got this third party zip file that (when extracted) contains a directory with 3 directories underneath it and in each of these directories there are a bunch of ".class"es. It's my first time using Eclipse so here's what I'm getting :
My project is stored (for example) underneath C:/EclipseWS. The current class I'm writing is called and it will be stored in the package tstpck.dbsuper (so C:\EclipseWS\tstpck\dbsuper).
The third party zip file I extracted into the C:\temp\thirdparty\ directory and it's called (again, for example)
In my class at the top I try and put something like ajavazip.nextdirectory.* but the ajavazip part gets underlined and Eclipse complains (The import ajavazip cannot be resolved). Can anyone tell me what I'm leaving out or doing wrong? I tried adding a CLASSPATH variable in system Environment variables (setting it to C:\temp\thirdparty) but it didn't do anything. Any help would be greatly appreciated.


Ravikanth kolli
Ranch Hand

Joined: Feb 10, 2008
Posts: 179

As far as i could understand what you are talking about you should include the zip in the build path of the project.

In eclipse right click the project -> and in build path -> configure build path and you can add external jars and zip files that you would like to use in your project.

hope this helps

I agree. Here's the link:
subject: Unable to import package
It's not a secret anymore!