jojo
jojo

Reputation: 13843

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

Upvotes: 0

Views: 210

Answers (2)

Vagaus
Vagaus

Reputation: 4215

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

Upvotes: 1

statenjason
statenjason

Reputation: 5180

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 a c# client

  3. Use the c# client to call Sum

Upvotes: 0

Related Questions