Using open source to integrate Java into .Net apps

Convert jar or class files into .Net applications or libraries

How can I integrate my existing Java library into a Java software library from a C# .Net program?

The IKVM.Net software tools provide an implementation of Java for the Microsoft .Net framework. IKVM provides a Java Virtual Machine (JVM) and a Java byte-code translator, ikvmc. Used in place of the normal Java command, the IKVM JVM runs Java applications and applets dynamically. The ikvmc translator converts Java applications and libraries into .Net executable programs and Dynamic Link Library (DLL) files.

The software is available from SourceForge through the download link at www.ikvm.net. To install it, unzip the download archive, add the program location to the system Path and copy the IKVM DLL files into the .Net global assembly cache. Use the .Net framework configuration program in the Windows control panel to copy DLL files to the .Net global assembly cache.

After the software is installed, use ikvmc to convert Java jar files or class files into .Net applications or libraries. Applications created this way will run natively under Windows, and library functions can be called directly from inside .Net programs. You can develop .Net software in Java with IKVM tools by creating jar files with the ikvmstub program, providing Java programming interface calls into .Net libraries, compiling your Java program together with the library stub(s) and converting the resulting Java classes into the final .Net program using ikvmc.

Blass is an IT manager in Phoenix; he can be reached at dr.internet@jschnee.com.

This story, "Using open source to integrate Java into .Net apps" was originally published by Network World.

Enterprise mobility 2018: UEM is the next step
  
Shop Tech Products at Amazon