Reputation:
My project is to develop a network analysis tool and I decided to use JUNG library. but I don't know how to get started and make use of it?I'm using eclipse IDE so how can I intergrate it in eclipse? thanks.
Upvotes: 1
Views: 642
Reputation: 114817
And just in case your working on a eclipse plugin or even an eclipse-rcp application, you should create a new plugin project that just contains this library. It's very simple: just open the wizard to create a new project: File > New > Project... > Plug-in Development > Plug-in from existing JAR archive
In any other case: create either a copy of the library directly in your project (I suggest: lib/jung.jar) and add that library to your buildpath (right-click on library) or create a User Library with the jar(s) and add that user library to the projects buildpath.
Advantage of user libraries: reusable in the same workspace & projects are loosely coupled to the dependencies (you can update a library without changing the project). Disadvantage: user libraries are defined in the workspace, so when you import the project to a different workspace, you'll break your dependencies.
A compromise might be to create one project that only contains libraries and add that project to he build paths. It's loose coupling like user libraries but you can export and import that project to to/from other workspaces.
Upvotes: 0
Reputation: 75426
Drag the jar files into Eclipse and drop them on your project (I believe you have only one). Right click on the jar file, and choose "Add to Build Path". It should then be immediately accessible.
Upvotes: 1
Reputation: 11529
To integrate an external library in Eclipse, simply go to your package explorer side view, right click on your project or on some file within your project, and go to properties. In the Java Build Path section, go to the libraries tab and add your library there. That should make it show up in your build path so that it will compile with your project.
I should mention that if it's just an external jar, simply click Add External JARs instead of Add Library.
Upvotes: 7