Differences between revisions 2 and 3
Revision 2 as of 2015-02-19 17:55:29
Size: 3881
Editor: MikeKucera
Comment:
Revision 3 as of 2015-02-19 18:01:38
Size: 3880
Editor: MikeKucera
Comment:
Deletions are marked like this. Additions are marked like this.
Line 68: Line 68:
{{attachement:debug_configurations_dialog.png}} {{attachment:debug_configurations_dialog.png}}

Describe Cytoscape_3/AppDeveloper/Launch_And_Debug_From_Eclipse here.

Launch and Debug your App using Eclipse

Overview

This page describes:

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

Launching Cytoscape from inside Eclipse

  • Click on the little arrow next to the External Tools toolbar button and select External Tools Configurations... from the dropdown menu.

external_tools_configurations.png

  • In the dialog double click on Program on the left. This will create a new launch configuration.

  • Change the name to cytoscape.sh (or cytoscape.bat if you are on Windows).

  • Under Location click the Browse file system... button.

  • Navigate to the location of your Cytoscape installation.
  • Select the cytoscape.sh file (or cytoscape.bat if you are on Windows).

  • Click Apply then click Run.

external_tools_dialog.png

Cytoscape should launch and you should see the console output in the Console View.

external_tools_console.png

Any time you want to launch Cytoscape click on the External Tools toolbar button.

Debugging your App

Any time you want to debug your app you need to do two things:

  1. Lauch Cytoscape in debug mode.
  2. Connect to the Cytoscape process from the Eclipse debugger.

Launching Cytoscape in Debug mode

To start Cytoscape in debug mode from the console, run Cytoscape with debug as the first command line argument:

  • In Windows: cytoscape.bat debug

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

To start Cytoscape in debug mode from inside Eclipse create another external tool launch configuration like the one created above.

  • Click on the little arrow next to the External Tools toolbar button and select External Tools Configurations... from the dropdown menu.

  • Right click on the cytoscape.sh launch configuration that you have already created and select Duplicate.

  • Change the name to cytoscape.sh debug .

  • Under Arguments add debug.

  • Click Apply then click Run.

external_tools_debug_dialog.png

The message Listening for transport dt_socket at address: 12345 will appear in the console. The Cytoscape process is blocked waiting for a connection from an external debugger.

Connecting to Cytoscape with the Eclipse Debugger

  • Click on the little arrow next to the Debug toolbar button and select Debug Configurations....

debug_configurations.png

  • Double click Remote Java Application.

  • Change the name to cytoscape.

  • Under Port enter 12345.

  • Click Debug.

debug_configurations_dialog.png

  • Switch to the debug perspective, go to the main menu and select Window > Open Perspective > Other > Debug. You should see Cytoscape running in the debug view.

The Eclipse Debugger

Here is a nice tutorial on how to use the Eclipse debugger: http://www.vogella.com/tutorials/EclipseDebugging/article.html

The Eclipse Java debugger supports a very nice feature called Hotswap. The debugger allows you to make changes to your code, compile them and run them without leaving the debugger or needing to restart Cytoscape. Simply edit some code and save the file and the new code should replace the old code in the debug session. Keep in mind that this only works with edits that do not change top level declarations. For example if you add a parameter to a public method or add a field to a class then the debugger will inform you that it cannot replace the old code. When this happens you will have start a new debug session.

Cytoscape_3/AppDeveloper/Cytoscape_App_Ladder/Launch_And_Debug_From_Eclipse (last edited 2017-04-26 19:52:39 by server2)

Funding for Cytoscape is provided by a federal grant from the U.S. National Institute of General Medical Sciences (NIGMS) of the Na tional Institutes of Health (NIH) under award number GM070743-01. Corporate funding is provided through a contract from Unilever PLC.

MoinMoin Appliance - Powered by TurnKey Linux