简体   繁体   中英

how can i C# application call a java application

can a C# application call a java application.

for example in C#

public int Sum(int a, int b)
{
    return // call java function to do the sum
}

then in Java will have a function do the actual sum

public int Sum(int a, int b)
{
    return a+b;
}

will COM+ help??

Thanks

I have never used IKVM myself but I do know people that used it successfully.

Anyway, have you tried the following options:

  • Use jacob : you can expose your java classes as COM objects that can be consumed by NET code.

  • Use jni4net

Best

Adriano

One thing you could try:

  1. Expose the Java as a Jax-Ws web service .

  2. Use .NET's svcutil.exe against it to generate ac# client

  3. Use the c# client to call Sum

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM