JNI Section Index | Page 13
When I try to access a native method from my DLL, I just get an "UnsatisfiedLinkError." What is the problem?
The problem is an incorrectly mangled name for your C / C++ function, which can occur when you try to access a native method from a Java class inside a package. In this case, you must call javah -...more
What are the viable alternatives for calling EJBs from non-Java programs? Specifically, I'm interested in calling EJBs (probably indirectly) from plain old C language.
Short answer: JNI See also How can I access my EJBs from COM environments such as VB? more
The best source for documentation is the Java Native Interface specification at http://java.sun.com/products/jdk/1.2/docs/guide/jni/spec/functions.doc.html There is a good tutorial published by S...more
You certainly can! Memory can be arbitrarily overwritten; the Java heap can be corrupted; and pretty much anything else you can do with a C pointer is possible with JNI. You can even convert you...more
I have an existing API library, which is written in C. I'm programming the Java side that should use this API. In order to do so, I want to use JNI. I started to wrap these functions and I have a problem with return types: almost all functions return pointers to the non-simple types, but to very complex types defined in that library. What can I do in such a case?
I suppose that you are addressing pointers to structures with "very complex types". Well, I can think of two ways: Write a wrapper method for each member of the structure. i.e.: type...more
How can I build a DLL in order to use it on Netscape 4.x browsers. What privileges do I need to grant the applet?
There is an excellent article in JavaWorld that explains the process of using JNI from an applet. http://www.javaworld.com/javaworld/jw-10-1998/jw-10-apptowin32.htmlmore
I want to find out from the Windows registry where a particular product has been installed. Is there any site that gives the native code and the JNI code to do this? If not, can you suggest a way by which this can be done?
You can get a free Java JNI package to manipulate the MS Windows Registry from http://www.trustice.com/java/jnireg/.
For an upcoming project, I will be calling Java from C++ on a multi-processor AIX UNIX box. I'm comfortable with the native code, but I am not clear regarding the appropriate Java threading model.
For an upcoming project, I will be calling Java from C++ on a multi-processor AIX UNIX box. I'm comfortable with the native code, but I am not clear regarding the appropriate Java threading model. ...more
Using native code/JNI, this is demonstrated at http://www.rgagnon.com/javadetails/java-0285.html.
J/Direct is Microsoft's second attempt to create a proprietary mechanism to connect Java programs to native libraries (the first being RNI). It provides direct access to Win32 libraries without re...more
RNI stands for Raw Native Interface. It was Microsoft's first proprietary mechanism to connect Java programs to native libraries on Windows. The preferred proprietary mechanism is now J/Direct.more
The source code for Essential JNI book is available from ftp://ftp.prenhall.com/pub/ptr/professional_computer_science.w-022/gordon/essential_jni/ejni_ex.zip.more
The source code for The Java Native Interface book is available from http://java.sun.com/docs/books/jni/.
Depending upon what you are looking for, try out some of the following: Roedy Green maintains a useful resource at http://mindprod.com/jni.html JavaWorld Tip 17: http://www.javaworld.com/javatip...more
JNI stands for Java Native Interface. It is the way to integrate your Java programs with legacy C/C++ code, including the ability to embed a JVM within your native applications.