Search code examples
javaeclipsezipbuildpath

Eclipse, Java: How to import a library in zip-format?


Ok, this is basic, but it seems that the normal way of doing this doesn't work for me.

I'm trying to import the jSSC library, for communication with serial ports etc. The newest library is jSSC-0.9.0-Release

So, I've tried the following:

  • Placed the zip file in the workspace and added it as "external jar" in the project properties -> java build path -> libraries.

Then I try including something from the library:

import jssc.SerialPortList;

Error: The import jssc cannot be resolved

  • Then I placed the zip file in a folder called /libs in the project root, and added it as "jar" (not external).

Result: Same error.

What basic info/action am I missing here, for this simple operation of importing a library?


Solution

  • Are you sure you should include the zip directly? In most releases, the zip contain a jar + readme + some documentation. I think you should take a look at the content of this zip file, perhaps extract it and only include the jar in your project.