While executing gcc
command on ubuntu for generating .a or .so file for JNI, getting below error for both openjdk 8 / oraclejdk8.
$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.
I have given example for generating .a file, but same issue observed for .so file generation also.
But same gcc
command works for openjdk7/oraclejdk7.
What is the issue here?