Call any Java method from C #

Is there a way to use JNI and C # code to create a program that calls any given Java method? Suppose I have a jar containing a hierarchy of classes, and I am responsible for loading the JVM and these classes, can I write a C # program that receives the values โ€‹โ€‹of the signature of the java method + arguments on the fly and calls the Java code?

Please try to limit your answers to free technologies (preference is given to JNI solutions).

+6
java c # interop jni
source share
2 answers

IKVM is one of the options. It implements the JVM in .Net and provides interoperability tools.

+3
source share

IMHO, the best way would be to run a Java program as a WebService (or create a WebService interface for it for it) and just call it from C #.

+3
source share

All Articles