File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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

It is sorta covered in the JavaRanch Style Guide.
subject: Unable to import package
It's not a secret anymore!