This is a demo project that shows the interop between Rust and Java, through the JNI.
It demonstrates the following usages:
RuntimeExceptions in Java.All these features are very needed in any serious business projects. You can also use this demo as a template to start developing your own project.
Clone this repo, and simply run mvn package in the project root.
The prerequisites are Java version 17 or above, and Rust toolchain.
You can find an example in example/src/RustJavaDemoExample.java. It fetches the web page content from the URL you provided as a cli argument. Once you build this project, you can run this example like this:
cd example/target
java -cp ./rust-java-demo-example.jar RustJavaDemoExample "http://www.greptime.com"
It will print the content of our website "http://www.greptime.com".
$ claude mcp add rust-java-demo \
-- python -m otcore.mcp_server <graph>