jni4net

    bridge between Java and .NET (intraprocess, fast, object oriented, open-source)

How to use



How it works

jni4net overview
Using reflection we grab public method signatures for core classes of .NET and Java and generated proxy classes for the other side.
We have .NET version of JNI API.
We use JNI to forward the call from .NET proxies to methods on real Java objects. (explanation)
We use JNI to register .NET implementation of native methods of Java proxies to forward call to methods on real .NET objects. (explanation)


Features



.NET/C# to Java Hello World -> Full sample

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!");
    }
}

Java to .NET Hello World -> Full sample

import net.sf.jni4net.Bridge;
import java.io.IOException;
import java.lang.String;

public class Program {
    public static void main(String[] args) throws IOException {
        Bridge.init();
        system.Console.WriteLine("Greetings from Java to .NET world!");
    }
}