# IKVM.NET User's Guide

- Introduction
- Overview
- System Requirements

### Introduction

IKVM.NET is a Java Virtual Machine (JVM) for the .NET and Mono runtimes. At a time when most people in the computer industry consider Java and .NET as mutually exclusive technologies, IKVM.NET stands in the unique position of bringing them together. Initially born out of frustration with the limitations of tools like JUMP and J#, IKVM.NET was created when Jeroen Frijters set out to create a way to migrate an existing JavaTM database application to .NETTM.

IKVM.NET has gone through a variety of designs and name changes to emerge as a sophisticated collection of tools offering a variety of integration patterns between the Java and .NET languages and platforms. It is still under development but people have reported success in running sophisticated applications and tools including Eclipse, JmDNS, JGroups, Jetty (with a few changes), etc.

This manual is written for IKVM.NET version 0.36.

### Overview

There are two main ways of using IKVM.NET:

- Dynamically: In this mode, Java classes and jars are used directly to execute Java applications on the .NETTM runtime. Java bytecode is translated on the fly into CIL and no further steps are necessary. The full Java class loader model is supported in this mode.

- Statically: In order to allow Java code to be used by .NET applications, it must be compiled down to a DLL and used directly. The bytecode is translated to CIL and stored in this form. The assemblies can be referenced directly by the .NET applications and the "Java" objects can be used as if they were .NET objects. While the static mode does not support the full Java class loader mechanism, it is possible for statically-compiled code to create a class loader and load classes dynamically.

IKVM.NET provides the VM-related technologies for byte-code translation and verification, classloading, etc. It is dependent upon the OpenJDK project for implementations of the JDK libraries.

IKVM.NET is comprised by the following components:

IKVM.NET Components
Component | Description
--- | ---

IKVM.Runtime.dll

The VM runtime and all supporting code. It contains (among other things):

- Byte Code JIT compiler/verifier: Just-in-time compiles Java Byte Code to CIL.

- Object model remapping infrastructure: Makes System.Object, System.String and System.Exception appear to Java code as java.lang.Object, java.lang.String and java.lang.Throwable.

- Managed .NET re-implementations of the native methods in Classpath.

IKVM.OpenJDK.ClassLibrary.dll | This is a compiled version of the Java class libraries, plus some additional IKVM.NET specific code.
IKVM.AWT.WinForms.dll | Very limited and broken implementation of a few AWT peers. This is a low priority issue until the platform stabilizes and works sufficiently well.
ikvm.exe | Starter executable, comparable to java.exe ("dynamic mode").
ikvmc.exe | Static compiler. Used to compile Java classes and jars into a .NET assembly ("static mode")
ikvmstub.exe | A tool that generates stub class files from a .NET assembly, so that Java code can be compiled against .NET code. IKVM.NET understands the stubs and replaces the references to the stubs by references to the actual .NET types.

### System Requirements

You must have one of the following .NET frameworks installed:

- Microsoft .NET Framework 1.1 (or later) SDK (Windows platform)
- Mono 1.2 (or later) (Windows or Linux)

by Stephen Schaub, Brian J. Sletten

Send feedback about this page to webmaster@ikvm.net Copyright © 2008 Jeroen Frijters All rights reserved.