pash
pash

Reputation: 63

Eclipse: How can I add a library?

it sounds probably really dumb, but how can I add a library to Eclipse? I'm trying this one, but I have no idea how to do it: http://code.google.com/p/streamscraper/

I tried alot of things now, but none of them worked out.

EDIT: This is the zip : http://streamscraper.googlecode.com/archive/f01d9ac6462902f0d2e7f6dc15cbef623ebe99f3.zip

EDIT2: It is a folder with classes

Upvotes: 0

Views: 160

Answers (1)

Jon Skeet
Jon Skeet

Reputation: 1499770

One simple way, assuming it's a jar file:

  • Make sure the jar file is in your project directory (so it should show up in package explorer)
  • Right-click the project root
  • Choose "Build path" / "Configure build path..."
  • Go to the "Libraries" tab
  • Click "Add JARs"
  • Navigate to the jar file and click OK

Or without even having it in your project directory, you can right-click on the project root, select "Build path" / "Add External Archives..." and find the file wherever it is. Personally I like having the jar file within the project directory though.

EDIT: It looks like you've actually got an Eclipse project there, basically. So extract the zip file, add the project to Eclipse (File / Import / General / Existing projects into workspace) and then make your project depend on that project via the build path.

By the looks of it, the zip file has some dependencies missing - you probably want to consult the project home page for any instructions on getting it building right.

Upvotes: 5

Related Questions