Build and run a sample app in Eclipse

Overview

Now that you have a collection of sample apps in Eclipse, here you'll learn how to build one of the sample apps called sample-create-network-view and run it in Cytoscape.

Process

1. Build a sample app

  1. In the Package Explorer panel on the top-left, click to expand the cytoscape-samples folder.

  2. Click to expand the sample-create-network-view folder.

  3. Right-click (or control-click if you're on a Mac) on the pom.xml file.

  4. Select Run As.

  5. Then select Maven install.

run-mvn-install.png






When Maven finishes building the app, you will see the Build success message in the Console tab, located at the bottom-center of Eclipse.

build-success.png

2. Install the app

Once the build finishes, open the target folder that's located directly above the pom.xml file. Inside you'll see the file sample-create-network-view-1.0.jar. This jar file is your newly built app.

To install the app, first open the CytoscapeConfiguration folder.

/!\ You will need to have run Cytoscape at least once beforehand.

If you're on a...

Do this to open CytoscapeConfiguration

Mac

Go to the Finder, then in the Go menu choose Home. You will find the CytoscapeConfiguration folder inside your home folder.

Windows

In Windows Explorer, go to C:\Users\Your-User-Name. You will find the CytoscapeConfiguration directory inside there.

Linux GNOME 3

In the GNOME Files application, click on the Home tab on the left. You will find CytoscapeConfiguration inside there.

Now that you have the CytoscapeConfiguration open, open 3, then open apps. You will find the installed folder there. Copy your jar file to the installed folder by dragging it from Eclipse while holding the option/alt key.

copy-app.png

{i} The CytoscapeConfiguration/3/apps/installed directory is where all active Cytoscape apps reside.

If you are using MacOS or Linux then you can avoid having to copy the jar file every time your app is rebuilt. This is done by creating a symbolic link from the Cytoscape apps folder to the App jar file in the Eclipse workspace. This only has to be done once.

To find the full path to the App jar file select the jar file in Eclipse and press Alt + Enter. The Resource Properties dialog will open and the full system path to the file is shown as the first entry in the dialog.

3. Run your app

Open Cytoscape. In the Apps menu, go to Samples, then choose Create Network View.

apps-menu.png






Your app will create a network view and a new node. Cytoscape will then look like this:

new-network-view.png

B-) You just built an app and ran it in Cytoscape.

Cytoscape_3/AppDeveloper/Cytoscape_App_Ladder/BuildAndRunSampleApp (last edited 2015-07-28 21:00:23 by 192)

MoinMoin Appliance - Powered by TurnKey Linux