Click here to Skip to main content
15,065,634 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a jar file (say: ABC.jar), which is having a function (say: jarfunc()).
I want to call that function in ASP.NET (c#). I am using VS 2008.
how can I do this?? should I extract the jar or is there any other way??
Please help.
Posted
Updated 14-Sep-12 0:09am
v2
Comments
Zoltán Zörgő 14-Sep-12 7:05am
   
Most important question (not clear for me): this jar file is a client side application and you want to call it from your page in the client browser (with JavaScript); or is it a server side something, and you want to interact with it during the server side execution?
arup 28-Nov-12 5:22am
   
k

Hi


Your main problem is the lanuage incomaptabilities

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

Question is what does the jar file do ? and can the same be done using .NET

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 asp.net 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


Oh and i found this

Using Java Classes in your .NET Application[^]
   
v2
Comments
Vipin_Arora 17-Sep-12 2:49am
   
throgh IKVM, when I am trying to convert the class file of java into DLL, It is creating with some warnings. It couldn't found some of the class files,but the class files are existing. can u help me where (on which location) it is expecting those dependencies, all files are currently residing with my class file??
You'll have to use http://www.ikvm.net/[^].
On the page explaining the uses of IKVM you'll find:


  1. Drop-in JVM
  2. Use Java libraries in your .NET applications
  3. Develop .NET applications in Java

Item 2. is just what you need.

Regards,

— Manfred
   
v2
Comments
Vipin_Arora 17-Sep-12 2:49am
   
throgh IKVM, when I am trying to convert the class file of java into DLL, It is creating with some warnings. It couldn't found some of the class files,but the class files are existing. can u help me where (on which location) it is expecting those dependencies, all files are currently residing with my class file??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900