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