JNI Section Index | Page 14
Does JNI work with Mac OS / MRJ?
Yes it does. If you are having trouble, you should see this tech tip from Apple:
http://developer.apple.com/technotes/tn/tn1155.html
Also take a look at:
http://developer.apple.com/qa/java/ja...more
Is it possible to write a single JNI native method that can dispatch to many C functions residing in any shared library (DLL)?
Yes, you can use the "Shared Stubs" example from http://java.sun.com/products/jdk/faq/jnifaq.html to call any C function residing in any shared library.more
How can I write JNI code which can run on JDK1.1.8, JDK1.2 and MS-JVM?
Use LoadLibrary/GetProcAddress to dynamically get the JNI entry points (on Win32 platform) instead of statically binding to the JNI libraries. On Unix you can use dlopen/dlsym which are equivalent...more
How can I throw an exception from JNI code?
jclass excCls = (*env)->FindClass(env,
"java/lang/IllegalArgumentException");
if (excCls != 0)
(*env)->ThrowNew(env, excCls, "thrown from native code");
more
What is Java 2 AWT Native Interface (JAWT) and how can I use it for native rendering?
There is an article at JavaWorld that explains this process:
http://www.javaworld.com/javaworld/javatips/f_jw-javatip86.html
more
How can i embed a Java VM inside my C/C++ application?
There is an article at Java CodeGuru that explains this process: http://codeguru.earthweb.com/java/articles/216.shtml.
How can i embed ActiveX controls inside a Java Application?
There is an article at The Code Project which explains how: http://www.codeproject.com/java/javacom.asp.
How can I use JNI in an applet?
Applets need to be trusted in order to execute the necessary System.loadLibrary() method. The PolicyManager will check for the RuntimePermission to loadLibrary.<library name>. This is separa...more
How do I cut and paste a Java Image to a an external program like Microsoft Paint?
As of today - no you can't :( in 100% pure Java. That is
because of the following bug and other related
bugs -
http://developer.java.sun.com/developer/bugParade/bugs/4040183.html
You can do that...more
How can I load a DLL (native library) and run something inside the DLL from a Servlet using JNI on JavaWebServer in Windows NT?
Is there anything special about JavaWeb Server so only JNI is not working?
Probably not, all you have to do is to learn how to use JNI. I used "Essential JNI" by
Rob Gordon.
What good books are there on JNI?
Besides the free online tutorial on the Java Native Interface from Sun, there are only two books about the topic. Essential JNI from Prentice Hall by Rob Gordon, with the other being The Java Nati...more
Can I write hardware interrupt handlers in Java using pure Java, JNI, or something else?
Using Java no, but using JNI you can write the same in language like c or c++, because currently only these two languages are supported for native interface in java.