简体   繁体   中英

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?

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.

I believe that your zip file contains a lot of files including jar file with all classes you need, documentation etc. So, extract zip file, find jar you have to add to your eclipse project and do that.

The zip probably contains readme instructions. Read them. This will probably help you to install and use the library.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM