Skip to content

PathVisio setup in Eclipse

De edited this page Jul 27, 2022 · 27 revisions

Note: the documentation below was tested for PathVisio 4 with:

  • Eclipse IDE 2022‑06, 64 bit, Linux (Ubuntu), Java 11

For PathVisio 3, this documentation was tested on:

  • Neon 3, Eclipse IDE for Committers, 32 bit, on Windows 7, Java 8.
  • Eclipse IDE (2019-03), 64 bit, Linux (Ubuntu), Java 8.

Note: items with a *** have a "Q&A" section at the bottom of this page.

Building with Ant:

  1. Download Eclipse, one of the Java developers' versions (download Eclipse latest version). Unzip the folder, and double-click the 'eclipse-inst' icon; select "install Eclipse for Java developer".

  2. Either work with the command line, or download Github Desktop (download).

  3. Fork the Pathvisio github repository to your own account, click on "Clone or Download" (green button), and then on “Open in Desktop”.

  4. In the toolbar, click on FILE/Import/General/"Existing Project into workspace” and click next.

image

  1. Browse to the folder where your local installation of the repository is saved (click the "Browse" button) and select the folder; click on "open" to select this folder. Select the option "search for nested projects", now all (sub)folders and files will be shown in the main field of this page. Deselect the Launcher (located in the Modules folder).

image

  1. Click on finish.

  2. The different folders from the github repository should now appear on the left in your workspace (under package explorer). Normally, errors will show up at this point.

image

  1. To allow for special characters: In Eclipse, navigate to the org.pathvisio.core folder [1] and select the file called build.xml file [2]. Now, with this file selected, use the toolbar to open the properties of this file: "File/Properties". Then, under "Resource/Attribute/Text file encoding" [3], select other, and then UTF-8 (if default detected is not UTF-8). Click "apply and close" [4].

image

  1. In order to set the correct dependencies, you should select a target platform, with the correct library. From the toolbar, select Window/Preferences. In the pop-up menu, click on Plugin Development/Target Platform***. Click on Add.

image

  1. Select the first option (Nothing, start with an empty target definition), and click next; Choose a name for your target platform, click add, select directory, click next:

image

  1. Click Browse, and select the folder called "lib" from the pathvisio repository (which you installed locally on your computer). Click Finish (2x), after which you should see*** the following change in the Preferences panel:

image

  1. Select the new target platform you created (in the example called Pathvisio), click Apply and then OK. Now Eclipse will build the workspace (you can track progress in the bottom right corner of Eclipse).

  2. The Package Explorer might now show only one red cross for the org.pathvisio.code folder (aka module) (top printscreen), or it will show no errors at all (bottom):

image

image

  1. Select the build.xml file (under org.pathvisio.core), and with right click select "Run as/2. Ant build" (Any other number in front of the word 'Ant' should suffice as well).

image

  1. You should see the output in the Console window (Text: BUILD SUCCESSFUL Total time: 6 seconds)***

  2. Click on the main folder (org.pathvisio.core) and press F5 to refresh the folder. Now, all the red crosses on the folder should have disappeared.

  3. In order to see the changes that you made to the code in Pathvisio, you have to create an option to run Pathvisio from your Eclipse code in Eclipse. Click on arrow next to the green run button (See image below), and select Run Configuration...

image

  1. Select OSGi framework, double click.

image

  1. Create a name for your run configuration (in the example PathVisioRun), click Apply and then Run.

  2. You should now be good to go. Start coding and have fun ;)

*** If you are missing the Plugin-Development environment, please go to: Help/Install software. Click on "all available sites" and search for General Purpose Tools>Eclipse Plug-in Development (see image below).

image

Click "Next" a bunch of times, accept the terms, and click finish. Restart Eclipse if needed.

*** If you receive the following warning, it is time to update your Eclipse installation (to avoid issues in the future):

image

*** If the build fails due to the Java version used (NOTE: PV needs the Java Developer Kit (JDK), not the Java Runtime Environment (JRE)), please take the following steps:

image

  1. Go to Window → Preferences, and search for Java. One option is called "Installed JREs":

image

  1. Click on "Add…" , then “standard VM” and select the local folder where you have a locally installed JDK version of java. Rebuild the workspace (by clicking Apply in the preference menu again.) and try to rebuild Pathvisio with Ant (step 13 above).

  2. If the above doesn’t work, add the JDK-HOME to your classpath. For more information on why to use JDK iso JRE, see: https://stackoverflow.com/questions/1906445/what-is-the-difference-between-jdk-and-jre )

Clone this wiki locally