Java和C#的互操作性 [英] Java and c# interoperability
问题描述
我有两个项目在c#,另一个在Java中。
那些方案将最有可能,总是在同一台机器上运行。
I have two programs one in c# and another one in Java. Those programs will, most probably, always run on the same machine.
什么是让他们互相交谈的最好方法是什么?
What would be the best way to let them talk to each other ?
所以,要澄清这个问题。
So, to clarify the problem
这是一个个人项目(所以专业/昂贵的图书馆是一个不走)
中的消息量不足,会出现每秒$ b $ 1〜2个消息b上的消息都很小,几个原始类型应该做的伎俩
我想保持低复杂度。
Java应用程序部署为一个jar作为其他应用程序的插件。所以,少外部库我有合并,就更好了。
我已经在C#应用程序的完全控制。
就像前面说的,无论是应用程序都在同一台计算机上运行。
现在,我的解决方案是使用套接字带有某种CSV样的格式。
This is a personal project (so professional/costly libraries are a no go) The message volume is low, there will be about 1 to 2 messages per second The messages are small, a few primitive types should do the trick I would like to keep complexity low. The java application is deployed as a single jar as a plugin for another application. So the less external libraries I have to merge, the better. I have total control over the c# application. as said earlier, both application have to run on the same computer. Right now, my solution would be to use sockets with some sort of csv-like format.
不过,我想感谢大家花时间回答我有点模糊的问题。
Still, I would like to thank everyone that took the time to answer my kinda vague question.
推荐答案
我的 jni4net ,JVM和CLR的开源间的桥梁。它是建立在JNI和PInvoke的顶部。没有C / C ++代码所需。我希望它会帮助你。
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.
这篇关于Java和C#的互操作性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!