Can I use Delphi to program to the Java Native Interface? From reading Essential JNI it seems possible if you make sure you are using the C calling convention. Anyone done this before? I would appreciate tips on tools that will help e.g. a tool to convert the C header file of Javah to Delphi.
+3
A:
you can check these projects and articles to use the JNI (Java Native Interface) and delphi
- Delphi-Java Bridge
- Java Native Interface and Delphi - Going Native - by Keith Wood
- Using the Java Native Interface with Delphi
RRUZ
2010-09-16 10:28:15
+2
A:
Besides JNI there is also Java Native Access (JNA) which requires much less setup (no C header files) so your Delphi DLL functions (and callbacks) can be used directly from Java:
JNA provides Java programs easy access to native shared libraries (DLLs on Windows) without writing anything but Java code—no JNI or native code is required. This functionality is comparable to Windows' Platform/Invoke and Python's ctypes. Access is dynamic at runtime without code generation.
mjustin
2010-09-16 13:42:27
Indeed, yes this is a brilliant product and I know its widely used, for example IntelliJ Idea uses it. I want to do COM interop however and would like make use of the nice Delphi support for that while at the same time provide a basic facade to my Java code.
Hannes de Jager
2010-09-17 08:37:27