2

How can I install the JGraphT distribution offered in this link:

http://sourceforge.net/projects/jgrapht/files/

I do not understand the tree structure of files and its relation with the structure of a project in Eclipse. I would like to run the java code listed in:

http://jgrapht.org/visualizations.html

but I am not able to import the proyect to Eclipse. For example, that .java file is under

jgrapht-0.9.0\source\jgrapht-demo\src\main\java\org\jgrapht\demo

capovawi
  • 377
  • 8
  • 21

3 Answers3

2

Follow these steps:

1) download the .zip file on that page

2) create a new java project in eclipse

3) unzip .zip file

4) right click on the 'src' folder and select 'import...' from file system

5) select 'src->org' under the unzip files

6) you will need 'jgraph' to run any of the examples

Destruktor
  • 463
  • 1
  • 4
  • 19
1

You can import the jars as internal/external jars into your project.

For example, right click on the project -> Build Path -> Configure Build Path

Then go to libraries and 'Add Jars' or 'Add External Jars' (if your jars are located outside the project space), you should now be able to import classes associated with JGraphT.

madcrazydrumma
  • 1,847
  • 3
  • 20
  • 38
1

This works for me: Install JGraphT in Eclipse. I just downloaded jgrapht-1.0.1.zip and I use Eclipse Oxygen (4.7.1). The link above describes the steps in detail. Basically, do the following:

  1. Download jgrapht-x.y.z.zip and extract it.
  2. In Eclipse, create a new Java project.
  3. Add the jars of the extracted jgrapht libraries to your Eclipse user libraries.
  4. Add the just-added user libraries to your project's Build Path as libraries.
  5. Now your project can make use of jgrapht.
Jimmy
  • 11
  • 2