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

Tutorial pubsub is compiling but not running

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

mfahad gravatar image

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

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(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.

edit retag flag offensive close merge delete

Comments

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 -0600 )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 -0600 )edit

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

damonkohler gravatar image damonkohler  ( 2013-02-21 01:36:21 -0600 )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 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

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

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

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

Seen: 976 times

Last updated: Dec 27 '13