Fog Creek Software
Discussion Board




Java bytecode to CLR

Does anyone know if it would it be possible to convert java byte code into an CLR executable or CLR code to Javabyte code? 

I am just curious.

John McQuilling
Friday, May 09, 2003

You could use something like JAD to turn Java bytecode into Java source code then using J# (or the Java .NET jump start or whatever it's called) you could compile to .NET bytecode.

Not exactly what you were after, but I'm pretty sure the above is feasible.

Walter Rumsby
Friday, May 09, 2003

These guys seem to be working on it:

http://weblog.ikvm.net/PermaLink.aspx/44664fcc-827b-43e2-9f89-859a75a5e516

Len Holgate
Friday, May 09, 2003

Most of the work in Java is done through API calls, such String handling, so I don't see that there would be much use to this. 

You might be able to convert the basic assignment, arithmatic and stack operations, but without those API calls the programs not going to do anything.

Ged Byrne
Friday, May 09, 2003

ikvm.net doesn't just convert Java bytecode to CLR bytecode (CIL), it also contains an (almost) complete Java class library (courtesy of the GNU Classpath project).

Jeroen Frijters
Friday, May 09, 2003

The entire Java class library, ported for the CLR!

That's pretty impressive.  Does it work?

Ged Byrne
Friday, May 09, 2003

Yes, although not everything is 100% done most notably AWT is completely missing. I have Eclipse running on .NET and that certainly is a non trivial application.

Jeroen Frijters
Friday, May 09, 2003

Ok.  What am I missing here? 
JAVA runs on windows and other OSs. CLR runs on MS products only.  Yet, from the comments it seems people are working on getting Java to run on CLR?

Is there a reason no one is extending CLR to run on other architectures or is it MS (as in they would have to do it) thing?

Mike Gamerland
Friday, May 09, 2003

what about jython to clr ?

c
Friday, May 09, 2003

"Is there a reason no one is extending CLR to run on other architectures or is it MS (as in they would have to do it) thing?"

Actually, the Mono project already has a partial implementation of .NET on Linux: http://www.go-mono.com/

There's another open-source reimplementation of .NET under way whose name escapes me at the moment.

Chris Nahr
Friday, May 09, 2003

The DotGNU project:
http://www.gnu.org/projects/dotgnu/

Brad Wilson (dotnetguy.techieswithcats.com)
Friday, May 09, 2003

>You could use something like JAD to turn Java bytecode i
>into Java source code then using J# (or the Java .NET
>jump start or whatever it's called) you could compile
>to .NET bytecode.

I have done that! I was porting some java stuff to .net
with J# - and had to convert from ANSII TO EBCDIC,
for all possible code pages.

Java has i18n.jar for this, but i didn't see anything parallel in .net - so i decompiled i18n and recompiled it with j#
worked.

didn't help me, was fired anyway ;-) My former employees are morons.

Michael Moser
Friday, May 09, 2003

Thanks for the DotGNU pointer, I wasn't even aware of that project. What I was thinking of was Rotor:
http://msdn.microsoft.com/net/sscli

Here's a description of this project:
http://www.ondotnet.com/pub/a/dotnet/2002/07/22/rotor.html

Rotor runs on Windows XP, FreeBSD, and Mac OS-X 10.2. It's not legal for commercial use, though, and probably won't ever cover enough library classes to be truly useful.  It's been set up by MS mainly as a teaching tool for third-party attempts to port .NET.

Chris Nahr
Saturday, May 10, 2003

Microsoft has a tool that converts inferior java bytecodes to superior MSIL bytecodes. Search on MSDN for it, it's called something like jbimp.

Clutch Cargo
Saturday, May 10, 2003

For those intersested in ROTOR you might want to check out the official ROTOR hacking site http://www.sscli.net/ .
Mind you, the SSCLI performance at this point is abysmal. MONO seems to be getting better every day (see: http://weblogs.cs.cornell.edu/AllThingsDistributed/ )

Just me (Sir to you)
Monday, May 12, 2003

I found Jbimp within the SDK on my recent VS2003 install.

On my system it is at:

C:\Program Files\Miscrofot Visual Studio .NET 2003\SDK\v1.1\Bin\Jbimp.exe

I've never tried using it but is says its a Java bytecode to .NET Assembly converter.

Steve Jones (UK)
Monday, May 12, 2003

*  Recent Topics

*  Fog Creek Home