0
$\begingroup$

Rosanswers logo

http://wiki.ros.org/rosjava_build_tools/Tutorials/indigo/Creating%20Rosjava%20Packages#Library_Project_.28Jar.29 I tried [4.2 Library Project (Jar)]. error by catkin_make

ubuntu@ubuntu:~$ cd src/rosjava_catkin_package_a<br> ubuntu@ubuntu:~/src/rosjava_catkin_package_a$ catkin_create_rosjava_library_project rosjava_gradle_subproject_a
ubuntu@ubuntu:~/src/rosjava_catkin_package_a$ cd ../..<br> ubuntu@ubuntu:~$ catkin_make
Base path: /home/ubuntu
Source space: /home/ubuntu/src
Build space: /home/ubuntu/build
Devel space: /home/ubuntu/devel
Install space: /home/ubuntu/install
####
#### Running command: "make cmake_check_build_system" in "/home/ubuntu/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/ubuntu/devel
-- Using CMAKE_PREFIX_PATH: /home/ubuntu/rosjava/devel;/opt/ros/kinetic
-- This workspace overlays: /home/ubuntu/rosjava/devel;/opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/ubuntu/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.8
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 2 packages in topological order:
-- ~~ - rosjava_catkin_package_a
-- ~~ - rosjava_catkin_package_b
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'rosjava_catkin_package_a'
-- ==> add_subdirectory(rosjava_catkin_package_a)
-- +++ processing catkin package: 'rosjava_catkin_package_b'
-- ==> add_subdirectory(rosjava_catkin_package_b)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/build
####
#### Running command: "make -j4 -l4" in "/home/ubuntu/build"
####
[100%] Gradling tasks for rosjava_catkin_package_a
warning: [options] bootstrap class path not set in conjunction with -source 1.7
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:19: error: package org.ros.concurrent does not exist
import org.ros.concurrent.CancellableLoop;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:20: error: package org.ros.namespace does not exist
import org.ros.namespace.GraphName;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:21: error: package org.ros.node does not exist
import org.ros.node.AbstractNodeMain;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:22: error: package org.ros.node does not exist
import org.ros.node.ConnectedNode;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:23: error: package org.ros.node does not exist
import org.ros.node.NodeMain;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:24: error: package org.ros.node.topic does not exist
import org.ros.node.topic.Publisher;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:29: error: cannot find symbol
public class Talker extends AbstractNodeMain {
^
symbol: class AbstractNodeMain
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:32: error: cannot find symbol
public GraphName getDefaultNodeName() {
^
symbol: class GraphName
location: class Talker
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:37: error: cannot find symbol
public void onStart(final ConnectedNode connectedNode) {
^
symbol: class ConnectedNode
location: class Talker
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:19: error: package org.apache.commons.logging does not exist
import org.apache.commons.logging.Log;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:20: error: package org.ros.message does not exist
import org.ros.message.MessageListener;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:21: error: package org.ros.namespace does not exist
import org.ros.namespace.GraphName;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:22: error: package org.ros.node does not exist
import org.ros.node.AbstractNodeMain;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:23: error: package org.ros.node does not exist
import org.ros.node.ConnectedNode;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:24: error: package org.ros.node does not exist
import org.ros.node.NodeMain;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:25: error: package org.ros.node.topic does not exist
import org.ros.node.topic.Subscriber;
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:30: error: cannot find symbol
public class Listener extends AbstractNodeMain {
^
symbol: class AbstractNodeMain
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:33: error: cannot find symbol
public GraphName getDefaultNodeName() {
^
symbol: class GraphName
location: class Listener
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:38: error: cannot find symbol
public void onStart(ConnectedNode connectedNode) {
^
symbol: class ConnectedNode
location: class Listener
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:31: error: method does not override or implement a method from a supertype
@Override
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:33: error: cannot find symbol
return GraphName.of("rosjava/talker");
^
symbol: variable GraphName
location: class Talker
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:36: error: method does not override or implement a method from a supertype
@Override
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:38: error: cannot find symbol
final Publisher publisher =
^
symbol: class Publisher
location: class Talker
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:38: error: package std_msgs does not exist
final Publisher publisher =
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:39: error: package std_msgs does not exist
connectedNode.newPublisher("chatter", std_msgs.String._TYPE);
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Talker.java:42: error: cannot find symbol
connectedNode.executeCancellableLoop(new CancellableLoop() {
^
symbol: class CancellableLoop
location: class Talker
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:32: error: method does not override or implement a method from a supertype
@Override
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:34: error: cannot find symbol
return GraphName.of("rosjava/listener");
^
symbol: variable GraphName
location: class Listener
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:37: error: method does not override or implement a method from a supertype
@Override
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:39: error: cannot find symbol
final Log log = connectedNode.getLog();
^
symbol: class Log
location: class Listener
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:40: error: cannot find symbol
Subscriber subscriber = connectedNode.newSubscriber("chatter", std_msgs.String._TYPE);
^
symbol: class Subscriber
location: class Listener
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:40: error: package std_msgs does not exist
Subscriber subscriber = connectedNode.newSubscriber("chatter", std_msgs.String._TYPE);
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:40: error: package std_msgs does not exist
Subscriber subscriber = connectedNode.newSubscriber("chatter", std_msgs.String._TYPE);
^
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:41: error: cannot find symbol
subscriber.addMessageListener(new MessageListener() {
^
symbol: class MessageListener
location: class Listener
/home/ubuntu/src/rosjava_catkin_package_a/rosjava_gradle_subproject_a/src/main/java/com/github/rosjava_catkin_package_a/rosjava_gradle_subproject_a/Listener.java:41: error: package std_msgs does not exist
subscriber.addMessageListener(new MessageListener() {
^
35 errors
1 warning

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':rosjava_gradle_subproject_a:compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
rosjava_catkin_package_a/CMakeFiles/gradle-rosjava_catkin_package_a.dir/build.make:57: recipe for target 'rosjava_catkin_package_a/CMakeFiles/gradle-rosjava_catkin_package_a' failed
make[2]: *** [rosjava_catkin_package_a/CMakeFiles/gradle-rosjava_catkin_package_a] Error 1
CMakeFiles/Makefile2:363: recipe for target 'rosjava_catkin_package_a/CMakeFiles/gradle-rosjava_catkin_package_a.dir/all' failed
make[1]: *** [rosjava_catkin_package_a/CMakeFiles/gradle-rosjava_catkin_package_a.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

Originally posted by ramekabi on ROS Answers with karma: 5 on 2017-12-06

Post score: 0


Original comments

Comment by jubeira on 2017-12-06:
Did you do step 4.1 before 4.2, or did you go straight to 4.2? I can't reproduce that on my side, but the error seems to be that catkin didn't find the core dependencies. That shouldn't happen after sourcing ~/rosjava/devel/setup.bash (or wherever you installed rosjava)

Comment by ramekabi on 2017-12-06:
I did 4.1 before 4.2 .
And I did [source ~/rosjava/devel/setup.bash].

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

You are using your home folder as workspace; that doesn't sound right. In the tutorial it's implicit, but in ROS you usually place the src inside a workspace folder.

So create a workspace folder where you place everything before proceeding. You should create the packages inside something like ~/my_rosjava_ws/src, and not just ~/src.

Let me know if it works that way; maybe that tutorial needs this clarification.


Originally posted by jubeira with karma: 1054 on 2017-12-06

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by ramekabi on 2017-12-06:
I tried tutorial that created a workspace. But, same error occurred. By the way, I use ROS on the RaspberryPi3. Is this the cause?

Comment by jubeira on 2017-12-07:
when you source your rosjava workspace, all those classes should be available for you. Go to ~/rosjava/devel/share/maven. Do you see folders with JAR files with the artifacts for rosjava_core?

Comment by ramekabi on 2017-12-09:
Sorry, I cannot understand what you say. Please tell me a command that I should do.
ubuntu@ubuntu:~/rosjava/devel/share/maven/org/ros$ ls
rosjava_bootstrap rosjava_core rosjava_messages

Comment by ramekabi on 2017-12-09:
Sorry, I cannot understand what you say. Please tell me a command that I should do.

ubuntu@ubuntu:~/rosjava/devel/share/maven/org/ros$ ls
rosjava_bootstrap rosjava_core rosjava_messages

Comment by jubeira on 2017-12-11:
It's a bit hard to tell what your problem is exactly. Does this tutorial http://wiki.ros.org/rosjava_build_tools/Tutorials/indigo/WritingPublisherSubscriber%28Java%29 (creating publisher/ subscriber) work for you?

$\endgroup$

Your Answer

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