Bug 834232 - Wrong include directive in "jni.h"
Summary: Wrong include directive in "jni.h"
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: java-1.7.0-openjdk
Version: 17
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Deepak Bhole
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-21 09:33 UTC by Marco Guazzone
Modified: 2012-12-03 21:36 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-06-21 16:13:51 UTC
Type: Bug
Embargoed:


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 09:33 UTC, Marco Guazzone
no flags Details

Description Marco Guazzone 2012-06-21 09:33:58 UTC
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 16:13:51 UTC
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 21:36:47 UTC
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.