I'm trying to build an app that can invoke java code from c++.
So that I could write something like this
#include<jni.h>
Then do something like this How to access the Java method in a C++ application I have problem adding libraries to CMakeLists.txt Thats what I have now:
cmake_minimum_required(VERSION 3.8)
project(test_cpp_jni)
set(CMAKE_CXX_STANDARD 11)
include_directories("${JAVA_HOME}/include ${JAVA_HOME}/include/linux")
link_libraries(${JAVA_HOME}/jre/lib/amd64/server/libjvm.so)
set(SOURCE_FILES
main.cpp
wrapper/WrapperJNI.cpp
wrapper/WrapperJNI.h)
add_executable(test_cpp_jni ${SOURCE_FILES})
target_link_libraries(test_cpp_jni ${JAVA_HOME}/jre/lib/amd64/server/libjvm.so)
What shall I correct/add to make this work. Thanks in advance for any help