A couple of options I’ve used and seen:
- Java Native interface - watch out for segfaults!
- Project Panama - early access
- GraalVM - still really new.
- zt-exec - call the native library as an external process
- remotetea - an old favourite if it’s legacy C++ code