tags:

views:

1377

answers:

4

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 ?

+10  A: 

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.

MagicKat
In the latest version of IKVM, the JDK library is broken out into separate assemblies. Depending on what you need, you probably won't have the full 30MB of baggage anymore. The jdk core assembly is about 5 MB.
Todd Stout
+1  A: 

alternatively you could write a webservice/xmlrpc layer between the two.

I seem to remember that there is a tool calles grassshopper that will compile your .Net code into JVM bytecode.

I've also heard good things about IKVM

Omar Kooheji
+1  A: 

Here's a few links that might help:

http://www.devx.com/interop/Article/19945/1954
http://www.ezjcom.com/?gclid=CJflqrms9ZUCFRqH1QodPSb_hA

Mainsoft do a .NET -> JVM cross compiler, but you may not want to recompile the .NET app:

http://dev.mainsoft.com/Default.aspx?tabid=130

Kev
+1  A: 

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.

Pavel Savara