[Documentation] [TitleIndex] [WordIndex

WARNING: This documentation refers to an outdated version of rosjava and is probably incorrect. Use at your own risk.

Using rosjava with Eclipse

Please read the rosjava build overview first. You will first need to get your package built using the normal ROS tools to bootstrap basic project configuration. Afterwards, you can switch to using Eclipse to manage your project.

rosjava comes with scripts that will automatically generate the Java build path that Eclipse needs. These scripts will look at your ROS packages' dependencies to determine:

All of this is done using the normal ROS <depend package="foo" /> dependency mechanism in the manifest.xml file.

Generating .project/.classpath

To generate the Eclipse .project/.classpath files simply:

rosmake <your-package-name>

This will generate the generate Eclipse .project and .classpath files if they are not already present. If you wish to replace an existing file, you must first delete it, then run rosmake.

The .classpath generation is similar to the ant build integration but includes some extra paths:

The ant integration does not include these paths with ros.classpath as it is assumed that build.xml maintainers will wish to use standard Ant mechanisms for configuring local resources.

TODO/NOTE: this .project generation does not currently support adding and Android project nature.

Setting up your Eclipse project

Once you have generated .classpath/.project files, you can use the normal Eclipse 'import' mechanism to create an Eclipse project:

File -> Import -> Existing Projects into Workspace -> root directory: <your package directory>

From there a convenient way to do your builds from inside eclipse is to include the 'Ant' view to your java perspective and add your build.xml to the view. Note that this needs eclipse indigo to work (needs the latest release of the ant plugin to work on ros style build.xml's).

It's also possible to debug your nodes by creating a debug configuration with org.ros.RosRun as the main class, and your Node class (fully qualified name) as program argument.


2022-05-28 12:58