This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 834232 - Wrong include directive in "jni.h"
Wrong include directive in "jni.h"
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: java-1.7.0-openjdk (Show other bugs)
17
Unspecified Linux
unspecified Severity high
: ---
: ---
Assigned To: Deepak Bhole
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-21 05:33 EDT by Marco Guazzone
Modified: 2012-12-03 16:36 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-21 12:13:51 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
A simple C++ that can be used to reproduce this error (see 'Steps to Reproduce') (33 bytes, text/x-c++src)
2012-06-21 05:33 EDT, Marco Guazzone
no flags Details

  None (edit)
Description Marco Guazzone 2012-06-21 05:33:58 EDT
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
  #include "jni_md.h"
at line 45 is wrong since this file is in the 'linux' subdirectory

Version-Release number of selected component (if applicable):
1.7.0.3-2.2.1.fc17.8.x86_64

How reproducible:
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.

Actual results:
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

Expected results:
No error.

Additional info:
To fix this problem, I think it should be sufficient to replace in file '/usr/lib/jvm/java/include/jni.h' the line 45:
  #include "jni_md.h"
with
  #include "linux/jni_md.h"
Comment 1 Deepak Bhole 2012-06-21 12:13:51 EDT
Hi. This is intentional. Please see #13:

http://java.sun.com/products/jdk/faq/jni-j2sdk-faq.html#jni_md
Comment 2 Orion Poplawski 2012-12-03 16:36:47 EST
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.

Note You need to log in before you can comment on or make changes to this bug.