This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Web Services and the fly likes How to Call the .NET(c#) Method from Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to Call the .NET(c#) Method from Java" Watch "How to Call the .NET(c#) Method from Java" New topic

How to Call the .NET(c#) Method from Java

udhaya kumarG

Joined: Jul 23, 2011
Posts: 15


I have gone through few web sites and have done few things like,

1. created DLL file
2.generated Header file using Javah -jni command.

still i am getting the following error "Exception in thread "main" java.lang.UnsatisfiedLinkError: no C:/ClassLibrary1.dll in java.library.path"

do we need to do anything after this for invoking C# method from Java?

help me out from this.

Thanks in advance.

Dhivya Krishnan
Ranch Hand

Joined: Apr 27, 2010
Posts: 68

I am also looking for the same. Can any one give a sample code for this. both a java program and .net program..

say for example., Add method is written in .net and java passes two parameters to .net and gets the result from there and prints in eclipse.

similarly two values are passed from .net for multiplication java performs the function and sends back the result.

Thanks in Advance. Request you to help asap.
I agree. Here's the link:
subject: How to Call the .NET(c#) Method from Java
It's not a secret anymore!