Tuesday, May 21, 2013

IKVM.NET in Details


IKVM.NET is an open source implementation or JVM for Microsoft .NET Framework and Mono. Suppose you have developed some library in java and you want to use in your .NET Projects, then IKVM.NET comes in role and helps to use java libraries in .NET. Now a days Java and .NET are two major technologies for software development and java is older technology and there were already lots of work has done. So when it comes to reusability then it is very common practice to use library created in java, require in .NET.


IKVM.NET includes following three main components:

1. A Java Virtual Machine implemented in .NET :  

It has a JVM which is developed using C#.NET, which provides facilities like byte-code translation and verification, class loading, etc.

2. A .NET implementation of the Java class libraries :

It basically uses OpenJDK project for implementations of the JDK libraries.

3. Tools that enable Java and .NET interoperability : 

IKVM.NET includes the following tools:  

a) ikvm - Java Virtual Machine

b) ikvmc - Compiles Java Bytecode to CIL

c) ikvmstub - Generates Java stub classes from .NET assemblies


a) IKVM.NET Virtual Machine (ikvm.exe):

This is Starter executable. We can compare it with java.exe ("dynamic mode") .It loads class file and execute its main method, if we pass class file name as parameter and it will execute java code in executable jar file ,if we pass jar file as parameter while execute it.

Syntax for use:       

 ikvm [ options ] classname [ args1,args2…..argsN]
 ikvm [ options ] -jar jarfile [args1,args2…..argsN]

Read more: Codeproject
QR: Inline image 1