March 4th, 2008, 09:26 AM
Bridging Between .NET and Java: Accessing .NET DLL From Java
As the title suggests, I am trying to find a suitable method for bridging between a Java application and a library (DLL) built from .NET.
I managed to find three possible solutions:
- Using JCom: A bridge library between Java and Com to enable COM object access from Java classes.
- Using JNBridge: Another component, similar to the one above except that it does not restrict communication to only COM-wrapped DLLs.
- Using a web-service to host the .NET library.
I have tried and experimented with all three methods and all of them seem to have a distinct setback. For instance, JCom does not support the use of arrays and so far I have not been successful in using JNBridge: certain exceptions are not documented. Also, consuming a .NET web-service has a performance issue.
I know that there is also the JNI framework that could be useful, however, I am not familiar with the syntax.
Hence, has anyone had any experience of using these approaches effectively? Does anyone know of any other alternatives? Any pointers would be greatly appreciated.
June 19th, 2013, 05:57 PM
Oh this thread is quite old... But issue is very rare and it took me a lot of time to find good solutions so to help others looking through google in this topic and meeting only outdated unanswered threads I would like to recommend brilliant solution that I found
Check Javonet it works like JNBridge but communication is done through JNI in-process so performance is very very high (like native) and in addition there are no wrappers, proxy classes generation. The solution is very light you just add single jar file to you JAVA project and use any .NET dll directly from JAVA code. It saved me lots of work and opened new possibilities of re-using .NET code from JAVA without rewriting from scratch or building server-client architecture.