从.NET中的API调用Java方法

问题描述:

我在jar文件中有一个Java API,其中包含来自其他jar文件的一些依赖项。

I have a Java API in jar file with some dependencies from other jar files.

有没有办法从这个API调用特定方法,比如使用PInvoke来自.NET?

Is there any way to call a specific method from this API, like using PInvoke from .NET?

谢谢。

在这里你走了:)我已经自己使用了它,非常喜欢这个实现。

Here you go :) I've used it myself and was very please with the implementation.

IKVM:在.NET应用程序中使用Java API


  • (1)如果你只需要一些来自Java的库

  • (1) If you just want some libraries from Java.

(2.1)如果你有权访问
代码。

(2.1) If you have access to the code.

(2.2)最后的手段,
将Java动态加载到.Net
(翻译)

(2.2) Last resort, dynamically load the Java into .Net (interpreter)