CLion JNI Follow
Completed
Hello,
how can I get CLion to find jni.h?
I'm working on Ubuntu 21.10, CLion 2022.1.3, created a new project -> C Library (C99 static).
main.c
#include <stdio.h>
#include <jni.h> // FILE NOT FOUND
int main() {
printf("Hello, World!\n");
return 0;
}
CMakeLists.txt
cmake_minimum_required(VERSION 3.22)
project(libask_cmake C)
find_package(JNI)
set(CMAKE_C_STANDARD 99)
add_executable(libask_cmake main.c)
if (JNI_FOUND)
message (STATUS "JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}")
message (STATUS "JNI_LIBRARIES=${JNI_LIBRARIES}")
endif()
Please sign in to leave a comment.
Solution that worked for me:
echo $JAVA_HOME must be available and:
CMakeLists.txt