Well… the moment you have to do FFI in Java is when you give up. It’s straight up the worst I’ve seen from all higher level languages. I rather do CGO than use JNI. Its actually less bad when using Rust but still bad.
Interesting, from 3 different jobs, all of them needed FFI. The first one was using C#. The second was Swift and Java (android). The current one is Java, NodeJS, C#, Python, Go.
This tends to happen when you want to write common shared libraries that are business critical and want one implementation only or when the library exist but in another language.