0
$\begingroup$

Rosanswers logo

Hi I am trying to run the pubsub tutorial using gradle.

The program compiles fine but when I try to run the listener program using the command;

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

it gives the following errors;

Loading node class: org.ros.rosjava_tutorial_pubsub.Talker Exception in thread "main" org.ros.exception.RosRuntimeException: Unable to locate node: org.ros.rosjava_tutorial_pubsub.Talker at org.ros.RosRun.main(RosRun.java:56) Caused by: java.lang.ClassNotFoundException: org.ros.rosjava_tutorial_pubsub.Talker 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) at org.ros.internal.loader.CommandLineLoader.loadClass(CommandLineLoader.java:239) at org.ros.RosRun.main(RosRun.java:54)

Can you please help me in figuring out what is going on. I did a little digging and my CLASSPATH variable is appearing blank but I am not sure how I can set it.


Originally posted by mfahad on ROS Answers with karma: 11 on 2013-02-14

Post score: 1


Original comments

Comment by damonkohler on 2013-02-19:
I can't reproduce this issue. Make sure you've followed the instructions exactly. For instance, I see that you've renamed the directory. Depending on how you went about this, it could be part of your problem.

Comment by mfahad on 2013-02-19:
Hi Damon, actually just today I realized it might not be because of rosjava. I was trying to compile and run a different java program and it gave me a similar exception and failed to run. So I think that my CLASSPATH is not right. When I try echo $CLASSPATH, it is blank. Any idea on the right path?

Comment by damonkohler on 2013-02-21:
The class path will be set automatically by the scripts Gradle generates.

Comment by mfahad on 2013-02-21:
This is strange then because I was not using gradle for the other program I was trying to run but still that was giving the same exceptions.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I C that its an year old, but probably its same as : http://answers.ros.org/question/34092/problem-running-rosjava_tutorial_pubsub/

So probably using this :

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

should run this.


Originally posted by aknirala with karma: 339 on 2013-12-27

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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