How to run JAVA Code under .NET Framework
Have you think any trick that compile Java in .Net Framework or vice versa. No or Yes Whatever your answer is but now I am going show you the trick in which our JAVA code will run under .net Framework. Before that let me introduce the some Technical Terms.
Mono is a free and open source project led by Xamarin (formerly by Novell and originally by Ximian) to create an Ecma standard compliant .NET Framework-compatible set of tools including, among others, a C# compiler and a Common Language Runtime.
The stated purpose of Mono is not only to be able to run Microsoft .NET applications cross-platform, but also to bring better development tools to Linux developers. Mono can be run on many software systems including Android (and most other Linux distributions), BSD, OS X, Windows, Solaris, and some for game consoles such as PlayStation 3, Wii, and Xbox 360.
But now we Here talk about IKVM.NET.
- A Java Virtual Machine implemented in .NET !!!
- A .NET implementation of the Java class libraries !!!
- Tools that enable Java and .NET interoperability !!!
Follow the steps To Combine both the technology in your system. Suppose that if you are creating any project in c#.net, and add the advantages of JAVA in same project then this is the method.
Download the .Zip File from http://www.ikvm.net/download.html . And unzip the folder, which look like this.
Create Project in C#.net and Add the Library of Java (IKVM) in your project. All the required functionality of Java reside in .DLL file. So include the required DLL file in our System from bin Folder. In our case I am including following two DLL file in my system.
Now on From Load Event I have written following code.
Run the Code you will get Output as given Figure 6.