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:
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user