How to call Java code from C#?

雨燕双飞 提交于 2019-11-27 00:53:08

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.

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.

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

There are so many options,

  1. sockets

  2. web services

  3. Message bus

  4. Use a/any database! (sorry if sound silly)

Here's a discussion which may be handy: https://gridwizard.wordpress.com/2015/01/14/java-and-dotnet-interop

Really depends on what you're building!

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!