Launching Cytoscape from Eclipse

Adam Treister edited this page Apr 26, 2018 · 14 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: https://github.com/cytoscape/cytoscape/wiki/Launch-and-Debug-from-Eclipse

Regular Launch Configuration

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

  • Start by building Cytoscape from source.

  • Launch Cytoscape normally using the cytoscape.sh script. Or if you already have an external tool launch configuration use it to launch cytoscape.

    • git/cytoscape/cytoscape/gui-distribution/assembly/target/cytoscape/cytoscape.sh
  • 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 cytoscape.sh 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”
  • 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
  • Click on “Bootstrap Entries”
  • Click on “Add External JARs…”

Note: these instructions changed for v3.7 with karaf update

  • Navigate to
    • git/cytoscape/cytoscape/gui-distribution/assembly/target/cytoscape/framework/lib/boot
  • Select the following jar files
    • branding-3.7.0-SNAPSHOT.jar
    • org.apache.karaf-launcher-3.7.0-SNAPSHOT.jar
    • org.apache.karaf-diagnostic-boot-4.2.0-SNAPSHOT.jar
    • org.apache.karaf-jass-boot-4.2.0-SNAPSHOT.jar
    • org.apache.karaf.main-4.2.0-SNAPSHOT.jar
    • org.osgi.core-6.0.0.jar
  • 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.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.