0
$\begingroup$

Rosanswers logo

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?


Originally posted by Markus Eich on ROS Answers with karma: 202 on 2012-05-21

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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 .


Originally posted by amittleider with karma: 227 on 2012-05-30

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.