- 4.5.1/GIT
- Oracle JDK 9.0.1 (there is no javah on EA 10)
- Gentoo Linux
- amd64/64bit
- If I do
javac -h on Functions.java I get no output. I do not get generated C/jni headers for Functions.java. I do get generated headers from Native.java. Its either a bug in javac -h handling, and/or Functions.java needs annotations since not inheriting Native stuff that triggers generation of headers in Java 9+. For the time being using javah in Java 9 for Funtions.java, but javah is no longer as of EA 10. Thus need to fix Functions.java to work with 9+ javac -h.
- Steps to reproduce
a. Install JDK 9+
b. javac -h -cp jna.jar com/sun/jna/Function.java
c. No headers are generated
Repeat A & B using Native.java you get generated headers.
Seems to be either not having annotations or not containing native methods. Something causes Native.java to generate its headers, and prevents Function.java's headers from being generated. The following command only works for Native.java. Using javah on the same works for both.
Does not generate com_sun_jna_Function.h but does generate com_sun_jna_Native.h
javac -h native -cp ${PN}.jar src/com/sun/jna/{Function,Native}.java
Generates both via legacy javah
javah -d native -cp ${PN}.jar com.sun.jna.{Function,Native}
From Java 9 javac man page
"-h directory
Specifies where to place generated native header files.
When you specify this option, a native header file is generated for each class that contains native methods or that has one or more constants annotated with the java.lang.annotation.Native annotation."
javac -hon Functions.java I get no output. I do not get generated C/jni headers for Functions.java. I do get generated headers from Native.java. Its either a bug in javac -h handling, and/or Functions.java needs annotations since not inheriting Native stuff that triggers generation of headers in Java 9+. For the time being using javah in Java 9 for Funtions.java, but javah is no longer as of EA 10. Thus need to fix Functions.java to work with 9+ javac -h.a. Install JDK 9+
b.
javac -h -cp jna.jar com/sun/jna/Function.javac. No headers are generated
Repeat A & B using Native.java you get generated headers.
Seems to be either not having annotations or not containing native methods. Something causes Native.java to generate its headers, and prevents Function.java's headers from being generated. The following command only works for Native.java. Using javah on the same works for both.
Does not generate com_sun_jna_Function.h but does generate com_sun_jna_Native.h
javac -h native -cp ${PN}.jar src/com/sun/jna/{Function,Native}.javaGenerates both via legacy javah
javah -d native -cp ${PN}.jar com.sun.jna.{Function,Native}From Java 9 javac man page
"-h directory
Specifies where to place generated native header files.
When you specify this option, a native header file is generated for each class that contains native methods or that has one or more constants annotated with the java.lang.annotation.Native annotation."