{"id":28765006,"url":"https://github.com/tuxcoding/rust-java-jni","last_synced_at":"2026-05-12T12:41:02.768Z","repository":{"id":146480102,"uuid":"80204616","full_name":"TuxCoding/Rust-Java-JNI","owner":"TuxCoding","description":"Experimenting project on how to connect Rust and Java together using JNI (Java Native Interface)","archived":false,"fork":false,"pushed_at":"2021-01-20T08:46:49.000Z","size":5,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-30T07:39:36.893Z","etag":null,"topics":["bridge","java","jni","rust"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TuxCoding.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-27T12:11:11.000Z","updated_at":"2018-12-21T16:19:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"50ee5b55-258f-4a53-86c9-a7e507264111","html_url":"https://github.com/TuxCoding/Rust-Java-JNI","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"00201df9514711f46758f2c6468db329837a44b3"},"previous_names":["tuxcoding/rust-java-jni","games647/rust-java-jni"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TuxCoding/Rust-Java-JNI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TuxCoding%2FRust-Java-JNI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TuxCoding%2FRust-Java-JNI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TuxCoding%2FRust-Java-JNI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TuxCoding%2FRust-Java-JNI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TuxCoding","download_url":"https://codeload.github.com/TuxCoding/Rust-Java-JNI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TuxCoding%2FRust-Java-JNI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32458237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bridge","java","jni","rust"],"created_at":"2025-06-17T10:13:22.663Z","updated_at":"2026-04-30T07:40:00.995Z","avatar_url":"https://github.com/TuxCoding.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust-Java-JNI\n\n## Description\n\nThis is a experimenting project on how to connect \n[Rust](https://www.rust-lang.org/) and [Java](http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html) \ntogether using the JNI API. So that you can execute native code from Java.\n\nThis repository can be used as reference guide on how to get started.\n\n## How to reproduce\n\n1. Add java methods with a native identifier\n2. Run `javah class-file` or  `javah -classpath path-to-jar files class-name`\n\n    path-to-jar could also contain multiple jars (`javah -classpath target/* Test`)\n        \n    class-name only contains the fully qualified class name without the `.class` extension\n3. Call your rust methods like the ones in the generated header file\n4. Compile the rust binaries into a library\n5. Load the library into Java using System.load(LIBRARY_PATH)\n6. Now you can access the native methods\n\n### How to compile and run\n\n1. Rust project: `cargo build` \u003e output into target/\n2. Java `mvn install` using [Maven](https://maven.apache.org/) (included in Eclipse, IntelliJ, Netbeans)\n3. Place the library file (.dll, .so) next to the jar file java/target/\n4. Run the jar file `java -jar jar-file`\n\n## Other useful documents\n\n* [Compile Rust-JNI to small library files](http://blog.ragozin.info/2016/07/rust-jni-java.html)\n* [First steps with Rust and JNI](http://nitschinger.at/First-Steps-with-Rust-and-JNI/)\n* [Java General JNI Documentation](https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/functions.html)\n\n## Supported OS\n\n* Windows (.dll)\n* Linux (.so)\n* Mac (.so and .dylib)\n\n## Planning\n\n* More complex examples\n* Complete `JNINativeInterface` in Rust according to the `jni.h file`\n\n## Contribution\n\nThis project is open for contributions of any kind. If you find a better example, description, [...],\njust make a pull request. \n\nThis project is licensed with the unlicense, so are free to do whatever you want. Including using\nit in your own project without credits.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuxcoding%2Frust-java-jni","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuxcoding%2Frust-java-jni","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuxcoding%2Frust-java-jni/lists"}