Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kud1ing/rucaja
Calling the JVM from Rust via JNI
https://github.com/kud1ing/rucaja
ffi java jni rust
Last synced: 3 months ago
JSON representation
Calling the JVM from Rust via JNI
- Host: GitHub
- URL: https://github.com/kud1ing/rucaja
- Owner: kud1ing
- License: apache-2.0
- Archived: true
- Created: 2016-12-11T08:49:23.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-09T22:12:16.000Z (almost 6 years ago)
- Last Synced: 2024-07-12T09:26:04.947Z (4 months ago)
- Topics: ffi, java, jni, rust
- Language: Rust
- Homepage: https://docs.rs/rucaja
- Size: 140 KB
- Stars: 31
- Watchers: 6
- Forks: 7
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Rucaja (Rust calls Java) [![Build Status](https://travis-ci.org/kud1ing/rucaja.svg?branch=master)](https://travis-ci.org/kud1ing/rucaja)
Calling JVM code from Rust via JNI.
## Usage
JNI calls are about 10-20 times slower than regular JVM instructions.
It is adviced to call as few functions as possible that do as much work as possible.Creating a flat Java wrapper class and producing a fat JAR with all the dependencies also reduces the amount of Rust interface code.
A more complete example is [kud1ing/tinkerpop-rs](https://github.com/kud1ing/tinkerpop-rs) which uses Rucaja to call [Apache TinkerPop](https://tinkerpop.apache.org).
## Platforms
The code is tested on Linux and macOS.
Your platform might need adjustments in `build.rs`.### Mac
Trying to run may give:
dyld: Library not loaded: @rpath/libjvm.dylib
Referenced from: ./target/debug/rucaja
Reason: image not found
Abort trap: 6this might require something like:
sudo ln -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib
## License
Licensed under either of
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)at your option.