-->

Is there a IKVM for Java? Can I run .NET assemblie

2020-08-09 07:40发布

问题:

IKVM is an amazing beast that lets me execute Java jars in a .NET environment. That is, it's a JVM written on the .NET runtime (CLR).

Does the opposite exist? Has someone written a CLR on top of a JVM? With suitable translation and base class library implementation, we might find .NET code executes more quickly in an aggressive JIT compiler, like HotSpot, than in the CLR JIT.

回答1:

The most Java programs run with IKVM (32 bit) a little faster as with Java SE. My test show 5-10% faster. That I think that MSIL code would be run slower with a HotSpot JIT.

The next problem is that MSIL has many more features as Java byte code. It can be difficult to emulate it and it consume performance.

With Mainsoft Grasshopper you have a solution that work on a Java EE server. I does not know a solution for a desktop GUI.



回答2:

You can call COM or ActiveX componenets usuing JACOB (Java COM Bridge) . That what I used only time I had to call my C# code from JAVA . Also check this link from StackOverflow How can I call .NET code from Java? Also googled this http://michaelkimsal.com/blog/running-net-code-on-a-jvm/



标签: java .net ikvm