JDK 1.8 on Linux missing JNI include file

后端 未结 3 2037
终归单人心
终归单人心 2021-02-12 17:33

I am trying to compile the following project:

https://github.com/entropia/libsocket-can-java

I always get this error message? Does anyone know

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-12 18:15

    No, this is not a bug. The correct way to solve this issue is to provide -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux compiler options. This way your build scripts remain portable.

    The OP is facing the problem on Linux, but if anybody is facing this problem on windows, please add following compiler options.

    -I"%JAVA_HOME%\include" -I"%JAVA_HOME%\include\win32" where JAVA_HOME points to your JDK installation directory, usually 'C:\Program Files\Java\jdk1.{7|8}.{}_{xx}'

提交回复
热议问题