开发者

Basic (working) tutorial calling C# code in Java using JNI

开发者 https://www.devze.com 2023-03-19 08:32 出处:网络
As the title states, I\'m looking for a b开发者_运维技巧asic (working) tutorial of Java code that uses JNI to call a \"hello world\" kind of application written in C#.

As the title states, I'm looking for a b开发者_运维技巧asic (working) tutorial of Java code that uses JNI to call a "hello world" kind of application written in C#.

The "best" I found is this, but I can't get it to work following the tutorial + the ready to use projects don't build in Visual Studio 2008.

I have to say that I have no .NET knowledge apart from creating a basic project and writing C# code. Once I have working projects I'll do something similar with the DLL (and source code) I received.

Thank you for your time.


Sounds like jni4net may be of use ? From the intro page:

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

So it looks pretty straightforward. Of course the devil is in the detail.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号