Saturday, October 10, 2009

jni4net - bridge JVM and CLR

jni4net
I'm proud to present first public release of jni4net - Object oriented, fast, intraprocess bridge between JVM and CLR.

Hello World!

From C# to Java
using net.sf.jni4net;
public class Program
{
    private static void Main()
    {
        Bridge.CreateJVM(new BridgeSetup());
        java.lang.System.@out.println("Greetings from C# to Java world!");
    }
}
This is very basic demonstration of the principle, full version of this sample and another 3 sample applications could be found in binary distribution. The others are same Hello World but from Java to .NET, usage of Apache FOP from C# for xsl:fo and last is creation of WinForms dialog from Java.


Please download here and talk back.

Next time I will write about why I created it, how it works, what are the features and what are the next steps. Watch this space.

2 comments:

Tharnadar said...

Hi Zamboch,
very nice post!
First of all, forgive my english.
I've some trouble with java/c# interops, i've a .net library that command an rfid reader, but my actual project is totally written in java and i must integrate the new device inside the old project.
I've seen that jni4net allow to use .net primitives, but is it possible to use your library to handle it?

Regards, Giancarlo

Z said...

Hi Giancarlo,

jni4net is already capable to wrap wide range of classes, both directions. I think you should give it a try. If you run into problems, talk back at our email group.