user1014191
user1014191

Reputation:

How to import .net library in eclipse?

Is there any way to import .net external library in eclipse. it is self created library and i want to import it into eclipse. is it possible ?

Upvotes: 1

Views: 2349

Answers (2)

Quintin B
Quintin B

Reputation: 5881

No. The .Net libraries are compiled into an Intermediary Language (IL) for specific use on the Microsoft .Net platform, meaning that only computers with the .Net framework can use them.

Java uses a similar idea, with a completely different purpose. Java code compiles into libraries which are designed to run on the Java platform, which would need to be installed on the computer that wants to run the binaries. The aim for Java, however, is that you can code once for a variety of operating systems. The goal for .Net, is to enable a variety of languages to compile down to the same language (IL).

You will have to look at porting the code INSIDE the .Net libraries to a more common runtime, like Mono (http://www.mono-project.com/Java).

However, there is no way a .Net dll is going to do you any favours in a Java environment. Even if you managed to get all the hooks in place, a .Net dll requires a .Net framework, which implies Windows, which is against the Java methodology.

Upvotes: 1

RedhopIT
RedhopIT

Reputation: 619

Yes you can do this by using Java Native Interface

Basic Tutorial Call C# Methods within Java Code

Upvotes: 1

Related Questions