Tuesday, August 26, 2008

Convert a Java Application to .NET

Yes.We can convert class files,jars files in to .Net Executable file format (dll) using the ikvmc tool.

IKVM.NET includes ikvmc, a utility that converts Java .jar files to .NET .dll libraries and .exe applications. In this section, we'll convert a Java application to a .NET .exe.

Navigate to IKVMROOT\samples\hello and enter the following:

ikvmc hello.jar

After the command completes, you should find a hello.exe file in the current directory. To execute it:

Windows / .NET Framework:
Try running hello.exe. If you get a FileNotFound exception when the .NET runtime attempts to load the referenced IKVM.OpenJDK.ClassLibrary.dll, remember that the .NET Framework expects to find referenced dll's in the application directory or in the Global Assembly Cache. Either install the dll's in the Global Assembly Cache, or copy them to the application directory.

Linux / Mono:

Run it using the following command:

mono hello.exe


For more details find the following links :

IKVMC.NET Tutorial
Download IKVMC.NET