J ++ for Java: how to port from RNI to JNI?

I inherited an old J ++ project. I have successfully upgraded this project to standard Sun Java.

However, this project includes a native C ++ dll, with which Java code interacts with

I don't know at all how to port a C ++ RNI dll to a JNI dll; I don’t know where to start. I have C ++ source code, but I don't know how to create a JNI dll. Are there any tips / tutorials / online materials that you can look for Java experts?

+3
source share
5 answers

If licensing is acceptable (LGPL), Java Native Access provides rather FFI friendly than JNI; porting can result in the removal of the RNI layer and a simple representation of a simple “C'-called API”.

+3
source

Take a look at JNA - you may be able to directly access the RNI DLL; or at least it will make the migration job a lot easier than manually JNI.

+3
source

, RNI → JNI ++ Java.

JNI JVM, . - , .

+2

Microsoft RNI, Sun JNI, , DLL RNI, DLL JNI. , RNI JNI.

, ++ RNI DLL, , , . ++/C, , RNI DLL, JNI. , , , , .

, JNI Wikipedia, JNI. - .

+1

Java Native Interface: - , JNI. RNI → JNI, * , JNI.

* , , , .

+1

Source: https://habr.com/ru/post/1717597/


All Articles