With IKVM.NET you can run compiled Java code (bytecode) directly on Microsoft .NET or Mono. The bytecode is converted on the fly to CIL and executed.
See the version list below for details.
Install-Package IKVM -Version 7.0.4335
dotnet add package IKVM --version 7.0.4335
<PackageReference Include="IKVM" Version="7.0.4335" />
paket add IKVM --version 7.0.4335
What's New (relative to IKVM.NET 0.46):
Integrated OpenJDK 7 b147.
Implemented Java 7 JVM changes.
Java annotations on statically compiled code are now returned as java.lang.reflect.Proxy objects for compability with broken code that assumes this is always the case.
Added delegate conversion for java.lang.reflect.InvocationHandler to ikvm.runtime.Delegates.
Various remap file improvements.
Changed build and JNI code to use different names for the Windows x86 and x64 versions of the native dll.
Retain reflection field ordering for ikvmc compiled code (not required by spec, but to improve compatibility with broken code).
Various AWT fixes.
Interop between java.lang.AutoCloseable and System.IDisposable.
Various build system improvements.
Added ikvmc -warnaserror option.
Fixed java.io.FileOutputStream in append mode to use atomic append.
Various performance improvements.
Added -Xnoglobbing option to ikvm.exe.
Various minor fixes.
Implemented dual stack sockets (Windows Vista and up only).
Implemented platform MBean server.
Implemented DatagramChannel multicast methods.
Removed mapping of System.Security.VerificationException to java.lang.VerifyError.
IKVM.Reflection: Massive enhancements to support a very large portion of the managed PE capabilities (much more than System.Reflection.Emit).
Code unloading (aka class GC) is not supported.
In Java static initializers can deadlock, on .NET some threads can see uninitialized state in cases where deadlock would occur on the JVM.
Only supported in the default AppDomain.
Only the JNICALL calling convention is supported! (On Windows, HotSpot appears to also support the cdecl calling convention).
Cannot call string contructors on already existing string instances
A few limitations in Invocation API support
The Invocation API is only supported when running on .NET.
JNI_CreateJavaVM: init options "-verbose[:class|:gc|:jni]", "vfprintf", "exit" and "abort" are not implemented. The JDK 1.1 version of JavaVMInitArgs isn't supported.
JNI_GetDefaultJavaVMInitArgs not implemented
JNI_GetCreatedJavaVMs only returns the JavaVM if the VM was started through JNI or a JNI call that retrieves the JavaVM has already occurred.
DestroyJVM is only partially implemented (it waits until there are no more non-daemon Java threads and then returns JNI_ERR).
DetachCurrentThread doesn't release monitors held by the thread.
Native libraries are never unloaded (because code unloading is not supported).
The JVM allows any reference type to be passed where an interface reference is expected (and to store any reference type in an interface reference type field), on IKVM this results in an IncompatibleClassChangeError.
monitorenter / monitorexit cannot be used on unitialized this reference.
Floating point is not fully spec compliant.
A method returning a boolean that returns an integer other than 0 or 1 behaves differently (this also applies to byte/char/short and for method parameters).
Synchronized blocks are not async exception safe.
Ghost arrays don't throw ArrayStoreException when you store an object that doesn't implement the ghost interface.
Class loading is more eager than on the reference VM.
Interface implementation methods are never really final (interface can be reimplemented by .NET subclasses).
JSR-133 finalization spec change is not fully implemented. The JSR-133 changes dictate that an object should not be finalized unless the Object constructor has run successfully, but this isn't implemented.
Strict class-file checking is not implemented.
Static Compiler (ikvmc)
Some subtle differences with ikvmc compiled code for public members inherited from non-public base classes (so called "access stubs"). Because the access stub lives in a derived class, when accessing a member in a base class, the derived cctor will be run whereas java (and ikvm) only runs the base cctor.
Try blocks around base class ctor invocation result in unverifiable code (no known compilers produce this type of code).
Try/catch blocks before base class ctor invocation result in unverifiable code (this actually happens with the Eclipse compiler when you pass a class literal to the base class ctor and compile with -target 1.4).
Only code compiled together during a single compilation fully obeys the JLS binary compatibility rules.
This package has no dependencies.
Showing the top 1 GitHub repositories that depend on IKVM:
Lean Algorithmic Trading Engine by QuantConnect (C#, Python, F#)