Ask Your Question

Tutorial pubsub is compiling but not running

asked 2013-02-14 16:17:57 -0500

mfahad gravatar image

updated 2014-04-20 14:09:49 -0500

ngrennan gravatar image

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( Caused by: java.lang.ClassNotFoundException: org.ros.rosjava_tutorial_pubsub.Talker at$ at Method) at at java.lang.ClassLoader.loadClass( at sun.misc.Launcher$AppClassLoader.loadClass( at java.lang.ClassLoader.loadClass( at org.ros.internal.loader.CommandLineLoader.loadClass( at org.ros.RosRun.main(

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.

edit retag flag offensive close merge delete


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.

damonkohler gravatar image damonkohler  ( 2013-02-19 10:40:03 -0500 )edit

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?

mfahad gravatar image mfahad  ( 2013-02-19 17:55:31 -0500 )edit

The class path will be set automatically by the scripts Gradle generates.

damonkohler gravatar image damonkohler  ( 2013-02-21 01:36:21 -0500 )edit

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.

mfahad gravatar image mfahad  ( 2013-02-21 02:34:24 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-12-27 20:08:22 -0500

updated 2013-12-27 20:09:52 -0500

I C that its an year old, but probably its same as :

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.

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

1 follower


Asked: 2013-02-14 16:17:57 -0500

Seen: 875 times

Last updated: Dec 27 '13