This content has been marked as final. Show 3 replies
user13656206 wrote:Probably not on any official site; several resources were lost in the migration from java.sun.com to Oracle. The book itself you can still find with a simple "java jni book" google search; the example code is probably a whole other story.
The Java™ Native Interface Programmer’s Guide and Specification mentions that source code for the book is at http://java.sun.com/docs/books/jni/
This just redirects to the Oracle site at http://www.oracle.com/technetwork/java/index.html as do the links at http://docs.oracle.com/javase/6/docs/technotes/guides/jni/
Do any of these links still exist anywhere on the Oracle site or elsewhere?
Is JNI still the only (or even best ) way to wrap C++ code in Java?No, there is also JNA which is a more recent alternative; people seem to prefer it.
If you want to see JNI code I can advise you to download the source code for the LWJGL API and see how the native bindings to OpenGL are done. That's pretty easy to follow as it is fairly flat code that still does nice things like pass around memory buffers and such.