Ask Your Question

Executing rosjava programs

asked 2011-08-26 20:48:23 -0500

Daniel Stonier gravatar image

Leaving android aside for the moment, what's the recommended way of executing a rosjava program buried in a main() in one of your classes?

Am asking because of the complexity of the CLASSPATH. This seems to be handled in the compilation, but I'm not sure how to bring it in when trying to run something.

edit retag flag offensive close merge delete


Just noticed rosjava_bootstrap's which will bootstrap the classpath for a NodeMain type class. Is there a way to do this for a generic class with a generic main?
Daniel Stonier gravatar image Daniel Stonier  ( 2011-08-27 02:50:19 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2011-08-27 11:02:29 -0500

kwc gravatar image

If you are implementing your own main(), I recommend looking at the rosjava_bootstrap script and adapting it to your own needs. The main thing of note is the Python routines for constructing the classpath.

Also of note is the, which shows the basic bootstrapping steps that you'll need for constructing a context.

All of this will get better over time -- we are evolving the toolchain to try and find the sweet spot of compatibility with the many different and varied frameworks that Java provides (e.g. Eclipse, ant, Maven, OSGI, Android, etc...).

edit flag offensive delete link more


Ended up doing exactly that (re-implementing my own Also found I could add ros.runtime.classpath from directly into an osgi xxx.bnd file which gives it rpath like tracking across jars. That will do for now. So many frameworks :)
Daniel Stonier gravatar image Daniel Stonier  ( 2011-08-27 15:50:36 -0500 )edit
There is someone who is working on support for osgi containers and done several different deployment scenarios with it. You should see the basic hooks in place for that, though it's not well documented.
kwc gravatar image kwc  ( 2011-08-28 06:35:32 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2011-08-26 20:48:23 -0500

Seen: 254 times

Last updated: Aug 27 '11