REDMOND, Wash. Want to run Java on .NET? Take a look at IKVM.NET.
At the Microsoft Lang.Next 2012 conference here, Jeroen Frijters, co-founder of Sumatra Software b.v. and the founder of the IKVM.NET project, demonstrated IKVM.NET, an open-source Java virtual machine on .NET.
Frijters said IKVM is the Java VM on top of .NET and the open-source Mono project to create .NET-compatible tools and to run .NET apps cross-platform. IKVM.NET features a just-in-tine (JIT) compiler that translates Java byte code to Microsoft Intermediate Language (MSIL). It also features a static compiler that translates Java classes into .NET assemblies, which is basically an ahead of time compiler for the JIT compiler. IKVM.NET also is a .NET port of the OpenJDK class library, Frijters said.
Frijters explained that he started work on IKVM.NET in the spring of 2002 as an experiment. And in a blog post June 2002 Frijters wrote:
I have a large Java application that I would like to slowly migrate to .NET. In order to be able to do that, I need a way to interoperate with Java code; the existing solutions I have looked at are inadequate. Besides, its lots of fun to build something like this :-)
IKVM.NET is compatible with Java 7, Frijters said. It provides a full Java platform on top of the .NET Framework.
An interesting by-product of the IKVM.NET work was IKVM.Reflection. Reflection is the process by which a computer program can observedo type introspectionand modify its own structure and behavior at runtime.
IKVM reflection is really nice; its even bigger than IKVM itself, Frijters said. Its used in the Mono C# compiler and others like Scala .NET and others.
Another nice benefit of Frijters work is that in addition to the key benefits of a JVM implemented in .NET, a .NET implementation of the Java class libraries and tools that enable Java and .NET interoperability, is that he has the Eclipse integrated development environment (IDE) running on the Microsoft Common Language Runtime, he said. Its actually faster than Eclipse on Java, he quipped.
I compiled all the Eclipse code to DLLs [dynamic link libraries] to assemblies, Frijters said. I cheated a little bit. But Eclipse has OSGi and to make that compatible with .NET, I had to write about 100 lines of code.
Frijters effort came out of a project he did for Mainsoft, he said. As a result, he completed a system for running Java on .NET that has helped many users.
David Levelt, a software engineer at WL Delft Hydraulics in the Netherlands, explained his use of IKVM.NET:
In this part of our software, different programming languages are used. The calculations in the models are done with FORTRAN 90. The communication between models is layered. The interprocess communication is implemented in Java. The OpenMI implementation, which takes care of the communication on model level, is written in C#.
To make the connection between these communication layers, we are using IKVM. A colleague informed me about the IKVM software. I read the documentation on the Website, downloaded and started combining it with our software. It was an instant success. It solved a lot of our multi-language problems. We haven't stopped using it.
Shamus Neville, a developer in the eTrading and analytics group at HSBC, said, We are very happy with IKVM. It enables us to develop our core libraries in Java and compile for use in .NET. The IKVM team is very responsive and knowledgeable about the issues we were facing.
And in a statement a couple of years ago, Otto Perdeck, development manager at Chordiant Software, now part of Pegasystems, said, Having used IKVM for over a year, we have found IKVM to work reliably and offer production-quality operation. The one time where we did run into some specific problem, the open-source nature of IKVM allowed us to quickly track down the bug and verify the cause of the problem. We had a fix for the problem the very same day.