ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

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 Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(

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


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

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: .

edit flag offensive delete link more

Question Tools


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

Seen: 987 times

Last updated: May 30 '12