BAEL-4234: example of JNI registerNatives() method (#11745)

* BAEL-4234: example of JNI registerNatives() method

* fixed formatting in the cpp file

* removed camelcase in test package name
This commit is contained in:
Maciej Główka
2022-02-19 05:19:07 +01:00
committed by GitHub
parent 69a8035696
commit 4b62cbfac7
5 changed files with 96 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
package com.baeldung.jni;
public class RegisterNativesHelloWorldJNI {
static {
System.loadLibrary("native");
}
public static void main(String[] args) {
RegisterNativesHelloWorldJNI helloWorldJNI = new RegisterNativesHelloWorldJNI();
helloWorldJNI.register();
helloWorldJNI.sayHello();
}
public native String sayHello();
public native void register();
}