update at 2022-02-22 20:29:33 by ehlxr

This commit is contained in:
2022-02-22 20:29:33 +08:00
commit f624b2eb80
6 changed files with 252 additions and 0 deletions

View 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);
}
}