Ask Your Question
0

Running a rosjava node

asked 2012-05-21 06:28:22 -0500

Markus Eich gravatar image

I managed to build my own rosnode with the new gradle build system. But when I run my node with the command ./build/scripts/mynode org.ros.mynode I get the following error

   Exception in thread "main" java.lang.NoClassDefFoundError: org/ros/RosRun
   Caused by: java.lang.ClassNotFoundException: org.ros.RosRun
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)

The same happens if I try to run the pub_sub tutorial with the command

  ./build/scripts/rosjava_tutorial_pubsub org.ros.rosjava_tutorial_pubsub.Talker

After having a look at the generated script, it just sets the classpath to

   CLASSPATH=$APP_HOME/lib/rosjava_tutorial_pubsub-0.0.0-SNAPSHOT.jar:$....

It seems that the class path is not set correctly, because APP_HOME points to pwd -P and there is no lib folder. What am I doing wrong in the execution of the rosnodes?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-05-30 08:30:59 -0500

amittleider gravatar image

Try running the tutorial using

./build/install/rosjava_tutorial_pubsub/bin/rosjava_tutorial_pubsub org.ros.rosjava_tutorial_pubsub.Talker

The path you are using looks like it might come from an old tutorial.

A lot of the documentation on the internet is old, so be sure to check the date when you read things. This is the best source of documentation at the moment: http://docs.rosjava.googlecode.com/hg/rosjava_core/html/index.html .

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2012-05-21 06:28:22 -0500

Seen: 865 times

Last updated: May 30 '12