Red Hat Bugzilla – Bug 834232
Wrong include directive in "jni.h"
Last modified: 2012-12-03 16:36:47 EST
Created attachment 593399 [details]
A simple C++ that can be used to reproduce this error (see 'Steps to Reproduce')
Description of problem:
In file '/usr/lib/jvm/java/include/jni.h' the following include directive
at line 45 is wrong since this file is in the 'linux' subdirectory
Version-Release number of selected component (if applicable):
Compile C/C++ a file which include the jni.h header.
Steps to Reproduce:
1.Create a C++ file 'try_java.cpp' with an empty 'main' and with the '#include <jni.h>' directive
2.Compile it (e.g., with gcc):
g++ -Wall -ansi -pedantic -I/usr/lib/jvm/java/include -o try_java try_java.cpp
3.You should get an error.
You get the following error:
In file included from try_java.cpp:1::
/usr/lib/jvm/java/include/jni.h:45:20: fatal error: jni_md.h: No such file or directory
To fix this problem, I think it should be sufficient to replace in file '/usr/lib/jvm/java/include/jni.h' the line 45:
Hi. This is intentional. Please see #13:
Hmm, that FAQ link appears to be broken now. So:
13. My compiler can't find jni_md.h!
Please add <jdk>\include\win32 or <jdk>/include/solaris to the include path of your compiler. Just <jdk>/include is not suffcient.
or <jdk>/include/linux as the case may be.