如何在 mono/linux 上从 Java 调用 .Net dll(函数)

How do I call a .Net dll (function) from Java on mono/linux

正如题主所说,这可能吗?我知道 jni4net 但它在 windows.

这是我得到的错误的摘录:

Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /tmp/mydll.dll which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Native code library failed to load.

您可能想要在 C 中创建一个从 Java 代码调用的函数,并调用 return 中的 C# 函数。

查看 here C 到 C# 的桥梁。

JNBridgePro 支持您的方案。它支持 运行 在 Mono 上连接 .NET 端,因此 .NET 端可以 运行 在 Linux 上。有关详细信息,请参阅 JNBridge 网站。

披露:我在 JNBridge。