我正在尝试使用JNI和JDK 9.我有一个类NativeTest.java看起来像这样的类:
public class NativeTest {
static {
System.loadLibrary("hello");
}
private native void sayHello();
public static void main(String[] args) {
new NativeTest().sayHello();
}
}
Run Code Online (Sandbox Code Playgroud)
我编译该类,然后用于javah NativeTest生成头文件.
签发后javah,我收到此警告:
Warning: The javah tool is planned to be removed in the next major
JDK release. The tool has been superseded by the '-h' option added
to javac in JDK 8. Users are recommended to migrate to using the
javac '-h' option; see the javac man page for …Run Code Online (Sandbox Code Playgroud)