On the JVM there is JNI (old, built in and stable but not very convenient as it requires writing C or C++), JNA (more modern, like an FFI, you just write Java), JavaCPP (can bind direct to C++ APIs, most advanced) and the new kid on the block Panama (built in but only in the very latest JDKs and still in preview mode).