0

I have .Net DLL, I need to interact with DLL from java . How to automatically generate java wrapper classes ? Is jni platform specific ? Is there any specific tool which will automatically generate java classes parsing .Net DLL.

Thanks in advance.

  • There is the https://github.com/nativelibs4java/JNAerator which can generate Bindings for C, C++ but not for .NET – Lonzak Mar 13 '17 at 07:56

1 Answers1

0

To my knowledge there is no way to interface with managed code (i.e. .NET) when using the Java Native Interface (JNI) tools packed with the Java Development Kit (JDK).

JNI is not platform specific, but you need unmanaged/native code (i.e. C++, I have not tried C yet) with a specific syntax to access the functions from Java.

When you are interested in working with JNI you should consider reading this specification from Oracle.

Daniel
  • 458
  • 5
  • 16
  • Thanks Daniel. Where can I get sample example of jni implementation. How about Jacob ? – Chethan Suresh Mar 12 '17 at 10:40
  • Here is a JNI example. It demonstrates what the signature of a C/C++ function has to look like: https://blogs.oracle.com/moonocean/entry/a_simple_example_of_jni Jacob is a Java/COM Bridge, you can interface with COM objects through it (for example the Excel API), when you just want to play around with COM you may use Jacob and not worry about JNI. – Daniel Mar 12 '17 at 13:22