This document provides instructions for setting up the development environment, building the cy3sbml
app, and contributing to its development.
cy3sbml
is a Cytoscape app, and standard development practices for Cytoscape apps apply.
For more details, refer to the official Cytoscape developer documentation:
To develop cy3sbml
, the following dependencies must be installed:
- Git (for source code versioning)
- Java JDK 17 (required for compilation)
- JavaFX
- Maven (version 3 or higher) (build automation tool)
- Cytoscape 3 (≥ 3.10.3) (required for testing and usage)
Download and install the latest Cytoscape 3 version (≥ 3.10.3) from:
http://www.cytoscape.org
Cytoscape apps are built using Maven (version 3 or higher). Follow the installation guide for your platform:
Apache Maven Installation Guide
To verify the installation, check the Maven version:
mvn -v
Cytoscape apps require Java JDK 17. Follow the installation instructions based on your operating system.
Install OpenJDK 17 with:
sudo apt install openjdk-17-jdk
Set the JAVA_HOME
environment variable:
sudo gedit /etc/bash.bashrc
Add the following line at the end of the file:
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
Save and close the file, then apply the changes:
source /etc/bash.bashrc
Verify the Java installation:
java -version
JavaFX is no longer bundled with the JDK, so it must be installed separately and configured in your IDE.
On Linux, install JavaFX using the package manager:
sudo apt-get install openjfx
To resolve missing JavaFX symbols in IntelliJ IDEA, add the JavaFX library manually:
- Open IntelliJ IDEA.
- Navigate to File → Project Structure → Project Settings → Libraries.
- Click + (Add Library) and select Java.
- Add the JavaFX library path:
/usr/share/openjfx/lib/
- Apply and save the changes.
For further troubleshooting, refer to this Stack Overflow discussion.
Clone the cy3sbml
repository from GitHub:
git clone https://github.com/matthiaskoenig/cy3sbml.git
The latest development branch is develop
. Switch to it using:
git checkout develop
To build cy3sbml
without running tests:
mvn clean install -DskipTests
To build and run tests (note: this may take a long time):
mvn clean install
The built .jar
file will be located in:
./target/cy3sbml-0.*.*.jar
With these steps completed, cy3sbml
is ready for development and testing.
The last step is installing the app. To update the app cy3sbml automatically after every build, set a symbolic link of the to the build cy3sbml jar in the Cytoscape installed apps folder.
ln -s $CY3SBML/target/cy3sbml-0.*.*.jar $HOME/CytoscapeConfiguration/3/apps/installed/cy3sbml-latest.jar
e.g.
ln -s /home/mkoenig/git/cy3sbml/target/cy3sbml-0.4.1.jar $HOME/CytoscapeConfiguration/3/apps/installed/cy3sbml-latest.jar
The link has to be updated with increasing versions.
Open the GitHub Repository with Intellij
- In Intellij, go to the File menu and choose Open.
- Navigate to the cloned git repository and open it.
The cy3sbml app should now be installed via a symlink (see above). Cytoscape can be launched from the command line in either normal mode or debug mode.
Open a command prompt and run:
cytoscape.bat # Normal mode
cytoscape.bat debug # Debug mode
Run the following command:
cytoscape.sh debug
You can set up a debug start configuration in IntelliJ IDEA to streamline the development process.
- Open IntelliJ IDEA.
- From the main menu, navigate to Run → Edit Configurations....
- In the upper-left corner, click + to add a new configuration.
- Select Shell Script as the configuration type.
In the Run/Debug Configuration dialog:
- Name: Set to an appropriate label (e.g., Cytoscape 3 Debug).
- Script: Navigate to the location of
cytoscape.sh
(e.g.,/path/to/cytoscape.sh
). - Interpreter Path: Set to
/bin/bash
(or the appropriate shell for your system). - Program Arguments: Set to
debug
if debugging, or leave blank for normal mode.
Click Apply and Close.
- Open Run → Cytoscape 3 Debug from the main menu.
- Cytoscape will launch, and the Run panel will display debug output, including:
The output after starting Cytoscape in debug mode should be one of the following:
Listening for transport dt_socket at address: 12345
You are now ready to debug and develop cy3sbml
within Cytoscape.
To debug cy3sbml
, we will configure IntelliJ IDEA to attach to Cytoscape's remote JVM for debugging.
- Open IntelliJ IDEA.
- From the main menu, navigate to Run → Edit Configurations....
- Click + to add a new configuration.
- Select Remote JVM Debug.
In the Run/Debug Configuration dialog:
- Name: Set an appropriate name, e.g., Cytoscape 3: cy3sbml.
- Debugger Mode: Select 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: Select
<no module>
. - Before launch: Click +, then select Run Maven Goal.
- Working directory:
/home/mkoenig/git/cy3sbml
- Command line:
compile
- Working directory:
- From the main menu, go to Run → Cytoscape 3: cy3sbml.
- Cytoscape should now be running with debugging enabled.
- Set breakpoints in your code, and IntelliJ IDEA will pause execution when those breakpoints are hit.
For a detailed guide on using the IntelliJ debugger, refer to:
Java Debugging with IntelliJ IDEA.
Java, along with Cytoscape, supports a feature called Hotswap, which allows automatic updates to your App without restarting Cytoscape.
- When the
cy3sbml
JAR file is placed in the following directory:~/CytoscapeConfiguration/3/apps/installed/
- Cytoscape will detect the change and automatically reload the updated App.
- This allows for faster testing and debugging without restarting Cytoscape.
- The howswap can be triggered via
mvn install -DskipTests
For more details, see the official documentation:
Cytoscape Java Hotswap.
For installation one can setup an environment variable referring to the cy3sbml source folder. This will simplify the subsequent steps
export CY3SBML=$HOME/git/cy3sbml
All necessary jars are available in the lib folder and the provided source code is tested and developed against the provided versions. So rebuild the JSBML jars only if you know what you are doing.
Clone JSBML repository and set environment variable
cd $HOME/git
git clone https://github.com/sbmlteam/jsbml.git
export JSBMLCODE=$HOME/git/jsbml
Update existing repository
cd $JSBMLCODE
git pull
Build the JSBML jars with the provided script and register in local mvn repository
$CY3SBML/lib/build_jsbml_jars.sh
If the version numbers change of JSBML or the extensions change, the build script and the respective versions in the
pom.xml
have to be updated.