3 ms·
JNI minimizes the Java trap, since your entire program doesn't need to live in the JVM. Other functionality can be implemented in native code, and it will work
by jakevoytko 16y ago
JNI minimizes the Java trap, since your entire program doesn't need to live in the JVM. Other functionality can be implemented in native code, and it will work with Java just fine. Oracle does not control native code, so they don't control what platform you target in the future. JNI is not a panacea - your code still runs on Oracle's JVM. But it provides an escape route, since pieces of your application can be ported away from the JVM without requiring an entire rewrite.
If you've reached this escape point, yes, you're wasting time by porting your application away from Java. But you knew Java is a closed platform owned by one company, and you took that risk.
- tomjen3 16y agoEven more importantly, you can start the JVM from C code -- indeed 'java' is nothing more than a simple wrapper around the necesarry DLL calls.