0

I have a c# application and I have a .jar file that I have created. I want to call from c# application, my jar file, I want to call a method in the jar file. I try to use JNI but I can't call jar file.

There is a mode to do this?

bircastri
  • 2,169
  • 13
  • 50
  • 119
  • It's not that easy. As Karvin suggested in the answer below, your best bet is IKVM which basically compiles JAR files into .NET assemblies which you can then use throughout your code. It is a good tool, but it really depends on the context in which you want to use it – barca_d Apr 30 '15 at 08:14

1 Answers1

0

Your main problem is the lanuage incomaptabilities

As far as i understand there is no direct way that Java (jar) and c# assembles can talk to each other.

Question is what does the jar file do ? and can the same be done using c#

If not then you are going to have to create a java application using somethign like Netbeans to act as a kind of middle man

Then when the c# application does a function call the call gets serialised into a file The java app should then look for the file (in a thread or something) pulling the data and writing the response data to the file

While asp.net looks for changes in the file and pulls the data back from the file once java has written

There are other options such as web service and TCP IP socket server to communicate

But Long story short there is no clear cut way as far as i am aware of that there is not clear cut way of making java and .net talk to each other .

A quick google search did bring up http://www.ikvm.net/userguide/tutorial.html[^] which seems to be promising.

Hope this helps