Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use a .Net assembly in Java

I want to use a Microsoft .Net Assembly in a Java Application. Is there any way out to do that.

Any help will be appreciated.

like image 901
Baig Avatar asked Feb 24 '23 11:02

Baig


2 Answers

Java and .Net run an fundamentally different systems: the JVM and CLR respectively. It's not possible to directly load one into the other and use it. They are incompatible formats.

It is possible though to have .Net and Java components interact through a bridge layer. There are several out there which provide this behavior

  • http://www.jnbridge.com/
  • http://java-dotnet-bridge.com/

Note: Most of these solutions though are aimed at sharing well defined components as opposed to directly loading libraries. This may or may not work for you.

like image 58
JaredPar Avatar answered Feb 26 '23 01:02

JaredPar


Something interesting on the same topic: ikvm

like image 44
Arjun Shetty Avatar answered Feb 26 '23 01:02

Arjun Shetty