致命错误:jni_md.h:没有#include“jni_md.h”的文件或目录
在 ubuntu 上执行命令为 JNI 生成 .a 或 .so 文件时,对于 openjdk 8 / oraclejdk8 都得到以下错误。gcc
$gcc -I/usr/lib/jvm/java-8-openjdk-amd64/include -c MainImpl1.c -o MainImpl1.o
In file included from MainImpl1.c:1:0:
/usr/lib/jvm/java-8-openjdk-amd64/include/jni.h:45:20: fatal error: jni_md.h: No such file or directory
#include "jni_md.h"
^
compilation terminated.
$gcc -I/usr/lib/jvm/java-8-oracle/include -c MainImpl1.c -o MainImpl1.o
In file included from MainImpl1.c:1:0:
/usr/lib/jvm/java-8-oracle/include/jni.h:45:20: fatal error: jni_md.h: No such file or directory
#include "jni_md.h"
^
compilation terminated.
我已经给出了生成.a文件的示例,但是在.so文件生成中也观察到了相同的问题。
但相同的命令适用于 openjdk7/oraclejdk7。gcc
这是什么问题?