cmake error: could not find JNI

asked 2018-03-31 10:37:31 -0600

OperationCrossbow gravatar image

updated 2018-03-31 10:50:10 -0600

Linux 16.04 LTS ROS Kinetic

context

Put tango_ros_messages from tango_ros_streamer package into catkin_ws/src as instructed by teacher. This folder has its own package.xml and CMakeLists.txt so should be fine.

problem

Trying to use the tango_ros_messages/save_map service:

$ rosservice list

returns available service:

/tango/save_map

But trying out the following:

$ rosservice info /tango/save_map

returns:

ERROR: Unable to load type [tango_ros_messages/SaveMap]

Have you typed 'make' in [tango_ros_messages] ?

Trying:

~catkin_ws/$ catkin_make

returns:

CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148(message): Could Not find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)

Trying:

~/catking_ws/src/tango_ros_messages$ make

returns:

make: * No targets specified and no makefile found. Stop.

Search results

The answers I found at:

https://stackoverflow.com/questions/1...

https://github.com/zeromq/jzmq/issues...

https://forum.byte-welt.net/t/could-n...

However, these do not help me as I'm unable to understand their responses. Furhtermore, as someone put it in the last link:

" I did a websearch for “Could NOT find JNI” cmake FindPackageHandleStandardArgs and this (and similar searches) brings hundreds of results, but only some strange bug reports and build logs without any explaination or solution…"

What is the cause of this error / How do I resolve it or avoid it? Thank you.

edit retag flag offensive close merge delete