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

Can't execute rosjava Nodes. RosRUn not found Exception

asked 2013-11-15 02:34:16 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I`ve been able to build and execute the tutorial_pubsub. Then i created a new Rosjava package in an existing catkin_ws. When i run gradle install and gradle installApp it all compiles right. But when i now try to execute these new nodes:

scryer@Scryer:~/catkin_ws/src/rosjava_foo$ ./build/install/rosjava_foo/bin/rosjava_foo ben.dude.Listener

i get:

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(
Could not find the main class: org.ros.RosRun. Program will exit.

What am i missing to execute Nodes that are not in the rosjava folder?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-10-10 12:49:20 -0600

jubeira gravatar image

Do you have the rosjava workspace sourced? RosRun is a class inside rosjava, and the script that you are running will assume you already have that class in your classpath.

If you installed rosjava from source, source the setup.bash file of its respective environment before trying to run your own node. That should work.

edit flag offensive delete link more

Question Tools


Asked: 2013-11-15 02:34:16 -0600

Seen: 357 times

Last updated: Oct 10 '17