开发者

Call any Java method from C#

开发者 https://www.devze.com 2022-12-26 03:40 出处:网络
Is there a way using JNI and C# code to create a program that invoke any given Java method? Assume that I have a jar containing classes hierarchy and I\'m responsible for loading the JVM and these cla

Is there a way using JNI and C# code to create a program that invoke any given Java method? Assume that I have a jar containing classes hierarchy and I'm responsible for loading the JVM and these classes, can I write a C# program that receives the java method signature + arg开发者_如何学运维uments values on the fly and call the java code?

Please try to restrict your answers to free technologies (JNI solutions prefered).


IKVM is one option. It implements a JVM in .Net and provides interop tools.


IMHO the best way would be to run the Java Program as a WebService (or create a Java based WebService Interface for it) and just call it from C#.

0

精彩评论

暂无评论...
验证码 换一张
取 消