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.
Thanks. I found both the book and the examples source code at http://126.96.36.199/docs/books/jni/
Yeah okay that's the link I also found for the book, I didn't realize the code was on there too :)
Better not post links to just any site in the forum though, especially ones that are simply an IP address. You never know what exactly you're linking too.