cancel
Showing results for 
Search instead for 
Did you mean: 

Java + JNI / JNA

Former Member
0 Kudos

Hello.

We use Netweaver Java on our Windows server 2012. Java version is 1.4.2 VM 4.1. Does it support JNI or/and JNA? What method (JNI or JNA) is better to interact between "managed" and "native" code? We need to call "native" library (dll) functions from Java application.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

oppancs
Contributor

Dear Arthur,


I deem you refer to Java Native Interface (JNI) and Java Native Access (JNA). For AS Java, JNI is supported but not alone. It is integrated as a layer in Sap Java Connector library and used for internal middleware calls (JNI / JRfc layer). Basecally the SAP Java Connector runtime environment consists of 3 parts:


1. sapjco.jar - java archive containing JCo's Java runtime classes.
2. {library prefix}sapjcorfc{shared library extension} - JNI runtime library containing JCo's native code.
3. {library prefix}rfccm{shared library extension} (librfc32.dll on Windows systems) - native RFC library used by JCo for handling remote function calls to and from an SAP System.


JCo's JNI runtime library acts as the linking part between JCo's Java classes and the native RFC including the network communication. Its main functional task is to do all the marshalling operations between the Java and the native RFC data types. Therefore JCo's Java runtime classes and its JNI runtime library tightly depend on each other. For a correct installation their version numbers and dates must be equal. In contrast to that there is only a loose coupling between the JNI runtime library and the native RFC library. The JNI library will exchange RFC data with the native RFC library and will delegate the management of RFC and network communication to it. Because the used RFC APIs will remain stable and downward compatible JCo only needs a specific minimum version of the native RFC library.


For more information about the middleware calls, see online help: https://help.sap.com/doc/saphelp_46c/4.6C/ja-JP/32/43f3b8d99d11d380a400c04fada2a1/content.htm?no_cac...


For more information about the architecture, see online help: https://help.sap.com/saphelp_nwpi711/helpdata/en/48/707a5f872c1b5ae10000000a42189c/frameset.htm


For more to use JCo library, see the link: https://support.sap.com/en/product/connectors/jco.html


And check the SAP Note: 1077727 - SAP JCo 3.0 release and support strategy.


Please be informed that JVM 1.4X/4.X and SAP Netweaver 7.0X versions have been not supported anymore since 1st January 2018. JVM 4 and NW 7.0X uses SAP JCo 2 and it has been not supported for years.


For JNA I was not able to find any standard SAP documetnation for NW AS Java.


Best Regards,
Barnabás Paksi

Answers (0)