2022-02-22 12:29:33 +00:00
|
|
|
Rust build
|
|
|
|
|
|
|
|
```shell
|
|
|
|
cd mylib
|
|
|
|
cargo build
|
|
|
|
```
|
|
|
|
|
|
|
|
Java build
|
|
|
|
|
|
|
|
```shell
|
|
|
|
cd java_src
|
|
|
|
javac me/ehlxr/HelloWorld.java
|
|
|
|
```
|
|
|
|
|
2022-02-23 01:41:05 +00:00
|
|
|
Java run
|
|
|
|
|
2022-02-22 12:29:33 +00:00
|
|
|
```shell
|
|
|
|
cd java_src
|
|
|
|
|
2022-02-23 01:41:05 +00:00
|
|
|
# Linux: export LD_LIBRARY_PATH=../mylib/target/debug/
|
|
|
|
# export JAVA_LIBRARY_PATH=../mylib/target/debug/
|
2022-02-22 12:29:33 +00:00
|
|
|
|
2022-02-23 01:41:05 +00:00
|
|
|
java -Djava.library.path=../mylib/target/debug/ me.ehlxr.HelloWorld
|
2022-02-22 12:29:33 +00:00
|
|
|
```
|