调用从C#的Java方法 [英] Call any Java method from C#

查看:143
本文介绍了调用从C#的Java方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有使用JNI和C#代码来创建调用任何给定的Java方法的程序的方式吗?
假设我有一个包含一个罐子的类层次结构,我负责加载JVM和这些类,我可以写接收动态Java方法签名+参数值的C#程序并调用java代码?

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 + arguments values on the fly and call the java code?

请尽量限制您解答免费技术(JNI解决方案者优先)。

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

推荐答案

IKVM 是一个选项。它在.net实现了JVM并提供互操作的工具。

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

这篇关于调用从C#的Java方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆