Skip to content

Launching Cytoscape from Eclipse

Mike Kucera edited this page Mar 7, 2022 · 21 revisions

How to Launch (and Debug, and Profile) Cytoscape from Eclipse

There are two ways to launch cytoscape from inside eclipse.

  • As an external tool
    • Easier to set up, more cumbersome to launch, slower to debug, some minor limitations, recommended for app developers
  • Directly using a regular launch configuration
    • Harder to set up, easier to launch, supports full-speed debug, supports YourKit profiler launch, recommended for core developers

External Tool Launch Configuration

Instructions are available on the App Dev Ladder:

Regular Launch Configuration

These instructions work on Mac and should work on Linux. Windows is probably similar.

  • Launch Cytoscape normally using the script.

    • git/cytoscape/cytoscape/gui-distribution/assembly/target/cytoscape/
  • Open a Terminal

  • Run this command

    • ps -A | grep java
    • Ubuntu Note: On Ubuntu, the ps command doesn't output the full command line arguments for a process, so I had to get the java process PID (in my case, 37012 ) and then do this: ps -fp 37012 -w > cytoscape_process.txt **
  • This will show the command that the script generates. We will create an eclipse launch config from this command.

    • If there is more than one java process Cytoscape is the one that ends with org.cytoscape.launcher.internal.Launcher
  • Go to eclipse, click the little down arrow next to the run button, and select Run Configurations…

    • This will open the Run Configuations Dialog
  • Click on “Java Application” and click the “New” button on the little toolbar above it.

  • Click on the Main tab (probably already open)
  • Give the run configuration a name such as “Cytoscape_HEAD”
  • Browse to select the "model-impl_impl" Project (note: different from old screenshot)
  • In the “Main class” field enter the following:
    • org.cytoscape.launcher.internal.Launcher
  • Click on the Arguments tab
  • Go back to the terminal
  • Select all the VM arguments from the command (starting at -Xms2048M and up to but not including the -classpath argument)

  • Copy-paste the arguments into the “VM arguments” text area in the eclipse run configurations dialog.

  • Add the following argument to the VM arguments (very important!!!)
    • -Dkaraf.lock=false
  • Click on the "Classpath" tab (may be called "Dependencies" in newer versions of Eclipse)
  • Click on “Bootstrap Entries” (or "Classpath Entries")
  • Click on “Add External JARs…”

  • Navigate to
    • git/cytoscape/cytoscape/gui-distribution/assembly/target/cytoscape/framework/lib/boot
    • Select all the jar files in this folder
  • If using Java 11 or higher navigate to
    • git/cytoscape/cytoscape/gui-distribution/assembly/target/cytoscape/framework/lib/jdk9plus
    • Select all the jar files in this folder
  • And like in the screenshot, also add JRE System Library to Bootstrap Entries (via Advanced...) and model-impl_impl to User Entries (via Add Projects...).
  • Click Apply
  • Click Run

To debug from Eclipse, you may need to add all of the Java Projects in the Source tab

You can now run/debug/profile Cytoscape directly from the eclipse toolbar. Enjoy :)

Known Issues

Some apps that rely on JavaFX may throw exceptions when attempting to load JavaFX classes.

  • I think this can be fixed by updating your Java install. Some earlier versions of Java 8 did not ship with the JavaFX classes. (This is the old case, with early Java 8.)
  • Starting in v. 3.8 of Cytoscape, Java 11 is required. JavaFX 13 must be loaded separately.
  • The Eclipse project has a project property specifying the Java version. If this doesn't agree with the version specified in the POM, confusing compiler errors will result.