Bridge between Java and C#

Alexey picture Alexey · Jan 17, 2012 · Viewed 8k times · Source

I have been given a task to create a bridge between C# and Java. It was said that if we use C# right now, and then we receive a Java file from somewhere else, we should be able to convert that Java file into .NET so it can be compatible with our software. The problem is I don't know what to do or how to even begin this task. Any suggestions or advice?

It was said that I initially have to make platform independent classes, if that helps.

*Edit: Sorry if I wasn't clear the first time, because I don't fully understand the task myself, which is why I am here. But from what I understand, I do have to create the bridge itself where I can call the source Java code from my .NET file. I have several months to finish it, so I assume that I have to make every library in Java compatible with C#.

I looked around for help, and found some similar projects: JNBridge(pay to use), Tangible(free demo), and Janett(open source), so that is what I am basing my opinion from.

**Edit: Let's say for example I create a Calculator class in Java. I would want to create the instance of that class in C#.

Answer

wsanville picture wsanville · Jan 17, 2012

I have never used this, IKVM.NET may be worth checking out.

IKVM.NET is an implementation of Java for Mono and the Microsoft .NET Framework. It includes the following components:

- A Java Virtual Machine implemented in .NET
- A .NET implementation of the Java class libraries
- Tools that enable Java and .NET interoperability

The one time I've seen it was a while ago, when working with a proprietary .NET based CMS. That assembly was used, but I'm not sure in what capacity.