Blog
Rust for systems, web, and embedded
Select topic
Select alladvanced-uis algorithms async automotive c++ c data-compression data-engineering development devops education embedded energy go interop iot irma java javascript kotlin lua meet-the-team meetup memory-safety microservices ntpd-rs open-data open-source pendulum privacy python react research rust security simd statime stm32 tech technology testing timing tools typescript web-development why-rust
RSS Feed February 10, 2025
Mix in Rust with Java (or Kotlin!)
Java is one of the most commonly used programming languages that we have not yet discussed in our Rust Interop Guide. In this article, we will discuss three different methods to call Rust code from Java: JNI, JNR-FFI and Project Panama. We will show the differences between these methods and we will do some basic benchmarking to compare their performance. These methods not only work for Java but also for other JVM languages like Kotlin. Here we will mainly focus on Java, but Kotlin examples are available in the Kotlin branch of our GitHub repository.