You are here

Eclipse IDE Setup

Introduction

This is a short guide to checkout Kinetic Models source code from the Sourceforge Subversion repository and correctly setup Eclipse to start developing.

Subversion repository checkout

Before checking out the project, download the following Subversion configuration file and override the one in

<USER_HOME>/Application Data/Subversion/config

Checkout the project trunk into the directory workspace-kineticmodels using the following command:

svn co https://kineticmodels.svn.sourceforge.net/svnroot/kineticmodels/trunk workspace-kineticmodels

Move inside the org-kineticsystem-commons module and execute the following command to compile the whole project:

mvn package

The first time Maven2 will download all the requested libraries from the default repositories.

Eclipse IDE configuration

You can download the latest IDE version from http://www.eclipse.org. The following steps are for Eclipse IDE version 3.2.2 but they should be easily adapted to the latest version.

Inside the org-kineticsystem-commons module execute the following command to configure all the projects to be used by Eclipse:

mvn eclipse:eclipse

Start eclipse an switch the workspace inside the directory workspace-kineticmodels.

Open the menu Window→Preferences... and select the option Java→Build Path→Classpath Variable. Add the classpath variable M2_REPO and set the value to the local Maven2 repository. This repository is by default in the directory

<USER_HOME>/.m2/repository

To import all the existing modules into the workspace open the menu File→Import... then select the option Existing Projects into Workspace and press the button Next . Select the directory containing all the modules, flag all the projects and press the button Finish.

Configuring for JDK version 6

If you have a different Java Virtual Machine running in your system and you want to configure Eclipse to work with JDK 6 you must select the menu Window→Preferences... and from the main tree select the node Java→Installed JREs. Here you can specify the virtual machine to be used as show in the next screenshot.

Maven2 integration

To execute Maven2 inside Eclipse you must select the menu Run→External Tools→External Tools... and create at least three new Program tasks. One example below.

An example of a clean project task.

Name: mvn clean
Location: ${env_var:M2_HOME}/bin/mvn.bat
Working directory: ${project_loc}
Arguments: clean

An example of an install project task.

Name: mvn install
Location: ${env_var:M2_HOME}/bin/mvn.bat
Working directory: ${project_loc}
Arguments: install

An example of a package project task.

Name: mvn package
Location: ${env_var:M2_HOME}/bin/mvn.bat
Working directory: ${project_loc}
Arguments: package

To execute a Maven task select a project from the Package Explorer or Navigator tab and click the corresponding External Tool button on the main toolbar as shown in the next screenshot.

To run or debug a Maven project you must select the menu Run→Debug... and create a new Java application as shown in the following screenshot.

To run or debug the KineticModels demo project you need this configuration.

Name: Data demo
Project: org-kineticsystem-commons-data-demo
Main class: org.kineticsystem.commons.data.demo.Demo

Subclipse installation

You can get the Eclipse Subclipse plug-in from http://subclipse.tigris.org