Skip to content

VirtualizationMode

Mehdi Mohammadi edited this page Dec 29, 2013 · 1 revision

In Virtualization mode, also known as IKVM mode, we translate Java syntax and constructs but not call to Java libraries so you can use IKVM.GNU.Classpath.dll as a replacement for Java libraries.

IKVM (like J#) has some tricks in base class library to help bridge native .Net and IKVM based applications. For example java.lang.String class has been inherited from System.String. Some of these tricks cause IKVM.GNU.Classpath.dll to be different from Java libraries. we fill these gaps in IKVM mode.

There are advantages to use Janett IKVM mode over IKVMCompiler. You can:

  • edit, debug, ... resulting code easily
  • run test-cases with NUnit
  • receive log messages with log4net
  • replace other third-party libraries as well
  • replace your API with .Net libraries . For example accepting System.IO.TextReader instead of java.io.Reader.

Code translated in IKVM mode will be built instantly, if all Java constructs are transformed by Janett, and unit-tests will pass, if Classpath Java implementation has the same behavior with Sun Java implementation and if IKVM tricks work.

In Janett, we will transform every Java construct to C# counterpart in later releases. Jeroen Frijters (IKVM developer) committed to use OpenJDK in IKVM ,so the second part of problem may be fixed in near future.

We recommend IKVMCompiler and Janett VirtualizationMode to be used for libraries (black-box) rather than frameworks. See also more interesting EmulationMode and NativeMode.

Clone this wiki locally