从JVM调用CLR代码 [英] Call CLR code from JVM

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

问题描述

是否可以从JVM调用CLR方法?是否可以在JVM内托管.NET CLR实例并为Java提供简单映射的库?有没有可以做到这一点的库?

Is it possible to call CLR methods from JVM? Any library that would host a .NET CLR instance inside JVM, and provide a simple mapping for Java? Are there any libraries that would do that?

我想为已经在JVM上运行的现有Java应用程序编写一个插件.

I'd like to write a plugin for existing Java application which already runs on JVM.

我想避免有两个二进制文件.我只想在现有的.NET程序集中(与MSBuild有关的Microsoft.Build.Framework.*东西)中调用几个方法.

I'd like to avoid having two binaries. I only want to call few methods in an existing .NET assembly (MSBuild-related Microsoft.Build.Framework.* stuff).

推荐答案

有两种不同的方法可以做到这一点. 您可以使用 IKVM 在CLR上运行Java. 相反,您可以嵌入Mono ,它是.NET CLR实现,尽管这需要使用C和JNI.
所有这些都假定您可以遵守开放源代码许可的条款.

There are two different ways to do this. You can run Java on the CLR using IKVM. Conversely you can embed Mono which is a .NET CLR implementation, although this will require using C and JNI.
All these assume that you can comply with the terms the open source licenses.

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

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