This repository contains sample Rust
programs that call Java
methods, and Java
classes that call Rust
methods.
cargo build --release
cargo
will generate .so
in target/release
, and call build_java.sh
to build .jar
, which contains .so
in resources
folder.
- call
Java
ecah JUnit test in IDE - call
Java
JUnit suite in IDE
Note: need to setup
JVM
args:-DsampleLib=<path to lib>
Thanks to metaworm(rust-java-demo). This article (url1/url2) is the most effective and detailed for learning how to call JNI
through Rust
.