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

Revision history [back]

click to hide/show revision 1
initial version

JNI is supported since my code is writen in C++. To get it to work I added to the CMakeLists:

set(CMAKE_CXX_FLAGS "-L /usr/java/jdk1.7.0_79/jre/lib/amd64/server/ -I /usr/java/jdk1.7.0_79/include/ -I /usr/java/jdk1.7.0_79/include/linux/ -ljvm -std=c++0x")

SET(CMAKE_CXX_COMPILER "/usr/bin/g++") set(JAVA_COMPILE "/usr/java/jdk1.7.0_79/bin")

find_package(Java REQUIRED) find_package(JNI REQUIRED)

if (JNI_FOUND) message (STATUS "JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}") message (STATUS "JNI_LIBRARIES=${JNI_LIBRARIES}") endif()

include(UseJava)