How to run Java code in the .NET Common Language Runtime

Started by Thorin, June 23, 2009, 04:27:11 PM

Previous topic - Next topic

Thorin

Who wouldn't want to be able to take all that old Java code they've got laying around and run it using the .NET Common Language Runtime?

Yes, rather than porting from Java to .NET, why not just install IKVM.NET and run your Java code as if it were .NET code?

While I agree this is a really interesting proposition, I gotta say that I'm scared at the hideous FrankenMonster that will be borne from this endeavour!

Quote
Use Java libraries in your .NET applications

IKVM.NET includes ikvmc, a Java bytecode to .NET IL translator. If you have a Java library that you would like to use in a .NET application, run ikvmc -target:library mylib.jar to create mylib.dll.

For example, the Apache FOP project is an open source XSL-FO processor written in Java that is widely used to generate PDF documents from XML source. With IKVM.NET technology, Apache FOP can be used by any .NET application.

Develop .NET applications in Java

IKVM provides a way for you to develop .NET applications in Java. Although IKVM.NET does not include a Java compiler for .NET, you can use any Java compiler to compile Java source code to JVM bytecode, then use ikvmc -target:exe myapp.jar to produce a .NET executable. You can even use .NET API's in your Java code using the included ikvmstub application.
Prayin' for a 20!

gcc thorin.c -pedantic -o Thorin
compile successful

Mr. Analog

I both love and hate this concept... I mean, you'd have to have A LOT of Java to migrate before you're thinking about this I'm hoping (and even then...)
By Grabthar's Hammer

Thorin

Yeah, might be easier to just train your .NET developers in Java, eh?
Prayin' for a 20!

gcc thorin.c -pedantic -o Thorin
compile successful

Mr. Analog

Quote from: Thorin on July 07, 2009, 11:07:35 AM
Yeah, might be easier to just train your .NET developers in Java, eh?

It's really not a tough conversion, I mean, I knew Java before I touched .NET and I've flipped between the two several times in my career.

The big thing you have to remember is the difference between running in a VM and running in a Framework and then just the little idiosyncrasies.
By Grabthar's Hammer