Ask Your Question
1

Can't execute rosjava Nodes. RosRUn not found Exception

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

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 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)
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
0

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

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

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: 2013-11-15 02:34:16 -0500

Seen: 304 times

Last updated: Oct 10 '17