Top "Java-native-interface" questions

The Java Native Interface (JNI) gives both the ability for JVM implementations to run system native code and the ability for native code to run Java code (by creating new JVM instances).

How to pass C structs back and forth to Java code in JNI?

I've got some C functions which I am calling through JNI which take a pointer to a structure, and some …

java c java-native-interface android-ndk
Calling Win32 API method from Java

I need to call some methods in Wininet.dll from a Java program. I can find plenty of tutorials on …

java winapi java-native-interface
In Java Swing how do you get a Win32 window handle (hwnd) reference to a window?

In Java 1.4 you could use ((SunToolkit) Toolkit.getDefaultToolkit()).getNativeWindowHandleFromComponent() but that was removed. It looks like you have to use …

java winapi swing java-native-interface hwnd
passing string array from java to C with JNI

I have a string array like {"myname","yourname","hisname"} and I am trying to send this array to C with …

java c java-native-interface
Java - Loading dlls by a relative path and hide them inside a jar

PART 1 I am developing a Java application that should be release as a jar. This program depends on C++ external …

java jar java-native-interface loading relative-path
How to catch JNI/Java Exception

I have a JNI layer in my application. In some cases Java throws an exception. How can I get the …

java-native-interface
NDK - How to use a generated .so library in another project

I have used ndk successfully to build & use a .so file in one project. I need to use this …

android android-ndk java-native-interface
What makes JNI calls slow?

I know that 'crossing boundaries' when making a JNI call in Java is slow. However I want to know what …

java performance java-native-interface
A correct way to convert byte[] in java to unsigned char* in C++, and vice versa?

I'm newbie in C++ and JNI, I try to find a correct way to convert byte[] in java to unsigned …

android c++ java-native-interface
.dll already loaded in another classloader?

I have a webapp running under Tomcat 3.2.1 that needs to make JNI calls in order to access data and methods …

web-applications java-native-interface javabeans