Skip to content

Launch and Debug from Intellij

Matthias König edited this page Apr 8, 2019 · 7 revisions

Launch and Debug your App using Intellij

This page describes:

  • How to launch Cytoscape with your App from inside Intellij.
  • How to debug your app using the Intellij debugger.

I presume you have installed your App using a symlink.

Launching Cytoscape

...in normal mode from the command line

  • In Windows:
cytoscape.bat
  • In Linux/Mac:
cytoscape.sh

...in Debug mode from the command line

Cytoscape can be started in 'debug' mode. When started in this manner the UI is not immediately started. Rather it prints the default debug port number and waits for a connection.

From the command line

  • In Windows:
cytoscape.sh debug
  • In Linux/Mac:
cytoscape.sh debug

The following shows an example of this run from the cytoscape/cytoscape directory. (As when cytoscape is built from its git repository.)

$ ./gui-distribution/assembly/target/cytoscape/cytoscape.sh debug
Listening for transport dt_socket at address: 12345
...

...from the Intellij IDE

  • From the main menu select Run and Edit Configurations...
  • In the upper left corner select '+', you will be prompted to Add a New Configuration, select Bash (This requires the BashSupport plugin)
  • You will be provided with a dialog for the configuration.
    • Set the name to something appropriate: Cytoscape 3
    • Script: navigate to location of cytoscape.sh
    • Interpreter path: /bin/bash
    • Program arguments: debug or leave blank if you are not debugging your App
    • Apply and Close
  • From the main menu select Run and Cytoscape 3

Cytoscape should launch and you should see the console output in the Run panel.

Debugging your App

...from the Intellij IDE

We will be defining a configuration for debugging our App.

  • From the main menu select Run and Edit Configurations...
  • In the upper left corner select '+', you will be prompted to Add a New Configuration, select Remote
  • You will be provided with a dialog for the configuration.
    • Set the name to something appropriate: Cytoscape 3: Create Network View
    • Debugger mode: Attach to remote JVM
    • Host: localhost, Port: 12345
    • Command line args: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=12345
    • Use module classpath: <no module>
    • Before launch: +
      • Run Maven Goal
      • Working directory: .../cytoscape-app-samples/sample-create-network-view
      • Command line: compile
  • From the main menu select Run and Debug Cytoscape 3

The Intellij Debugger

Here is a nice tutorial on how to use the Intellij debugger: Java Debugging with Intellij

You can’t perform that action at this time.