update at 2022-02-22 20:29:33 by ehlxr
This commit is contained in:
15
java_src/me/ehlxr/HelloWorld.java
Normal file
15
java_src/me/ehlxr/HelloWorld.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package me.ehlxr;
|
||||
|
||||
public class HelloWorld {
|
||||
static {
|
||||
// Linux: export LD_LIBRARY_PATH=/Users/ehlxr/Desktop/jni_rs/mylib/target/debug
|
||||
// Mac: export JAVA_LIBRARY_PATH=/Users/ehlxr/Desktop/jni_rs/mylib/target/debug
|
||||
System.loadLibrary("mylib");
|
||||
}
|
||||
private static native String hello(String input);
|
||||
|
||||
public static void main(String[] args) {
|
||||
String output = HelloWorld.hello("Java");
|
||||
System.out.println(output);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user