Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to call Java code from C#?

Tags:

java

c#

We've developed a Java application and would like to use this application from a C# client. The application has dependencies on Spring, Log4j, ...

What would be the most efficient mechanism - make DLL(s) from Java code, ... - to achieve this ?


2 Answers

IKVM!

It is really awesome. The only problem is that it DOES add ~30MB to the project. log4net and Spring .NET are available as well, but if living with existing code, go the ikvm route.

like image 82
MagicKat Avatar answered Sep 08 '25 10:09

MagicKat


I am author of jni4net, open source interprocess bridge between JVM and CLR. It's build on top of JNI and PInvoke. No C/C++ code needed. I hope it will help you.

like image 38
Pavel Savara Avatar answered Sep 08 '25 10:09

Pavel Savara