Taken Advantage of Java Open Source in .NET

4. August 2006 04:56 by Mrojas in General  //  Tags:   //   Comments (0)

We must recognize that there is a great amount of Java Open Source projects. It would be great to have access to all that code also in .NET but sometimes the migration of that functionality can take a while and you just need it right away.

For simple things you can use the J# implementations, and share your assemblies with C# and VB.NET applications. For medium things you might also think in using the JLCA so you will get a C# implementation ;) but some big projects could take more time that what you have available or taking a long time just does not worth it.

Well some guys have an superinteresting project. It is called IKVM. It allows you to compile your Java projects for .NET. IKVM.NET is an implementation of Java for Mono and the Microsoft .NET Framework.

This is an extract from their site http://www.ikvm.net/index.html:

Use Java libraries in your .NET applications

IKVM.NET includes ikvmc, a Java bytecode to .NET IL translator. If you have a Java library that you would like to use in a .NET application, run ikvmc -target:library mylib.jar to create mylib.dll.

For example, the Apache FOP project is an open source XSL-FO processor written in Java that is widely used to generate PDF documents from XML source. With IKVM.NET technology, Apache FOP can be used by any .NET application.

Develop .NET applications in Java

IKVM provides a way for you to develop .NET applications in Java. Although IKVM.NET does not include a Java compiler for .NET, you can use the open source Jikes compiler to compile Java source code to JVM bytecode, then use ikvmc -target:exe myapp.jar to produce a .NET executable. You can even use .NET API's in your Java code using the included ikvmstub application.

So if there was a Java Project that you were crying to use, stop now, wipe your tears and start using IKVM now.