/rust_java_samples

rust-java samples

Primary LanguageJavaMIT LicenseMIT

rust-java samples

Chinese version, 中文版

desc

This repository contains sample Rust programs that call Java methods, and Java classes that call Rust methods.

build

cargo build --release

cargo will generate .so in target/release, and call build_java.sh to build .jar, which contains .so in resources folder.

how-to

  1. call Java ecah JUnit test in IDE
  2. call Java JUnit suite in IDE

Note: need to setup JVM args: -DsampleLib=<path to lib>

sample list

sample list

thanks

Thanks to metaworm(rust-java-demo). This article (url1/url2) is the most effective and detailed for learning how to call JNI through Rust.