Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Java 1.5 for the .NET Platform

Java 1.5 for the .NET Platform

Leia em Português

This item in japanese


Ja.NET is a port of Java 1.5 SE to the .NET platform. The compiler is based on the Eclipse JDT, which has been modified to generate IL as well as Java Byte Code. Java traditionally compiles each class into a separate file, but this creates an unacceptable overhead for .NET. To address this, a tool based on Cecil is used to create larger assemblies much in the same way Jar files are created for Java.

In order to get a head-start on library support, the Ja.NET JDK is based on the open source project Apache Harmony. Dave Tillman writes,

One thing that attracted me to Harmony, as opposed to the OpenJDK, is the libraries in Harmony are already organized nicely into modules. For example, you’ll find a LUNI module which stands for Lang-Util-Net-Io, a NIO module, etc. BTW, as a side note, I actually began working with OpenJDK and actually have a running version of that as well on my machine, but chose to switch to Harmony a while back.

When we talked to Dave, he gave InfoQ some more details on what that entails,

At this point the Ja.NET SE project is solely focused on Java SE. Providing a Java 5 JDK for .NET. Before moving higher up the stack (Java EE), I think we need to get SE done, and done right. All of the Java 5 SE libraries are included in the distribution, BUT, not all of them are fully functional. You see I'm basing the work on several upstream projects (see my lateset blog for some details - The biggest is the Apache Harmony project. Harmony has developed code for most all (99.x%) of Java 5 SE class libraries, including Swing, AWT, etc. They also have Java ME and Java 6 code as well.

The Ja.NET SE class libraries are derived from the Harmony code, and today I build all of the code from Harmony into assembies for .NET and include them in the distribution. BUT not all of the work of modifing the class library code to tie it into cooresponding .NET/CLR services has been completed at this point. For example, the work to tie Swing and AWT into WPF has not been done ... that's why I'm looking for contributors ;-). To do this, a person would have to take the Swing/AWT code base that is already provided by Harmony, rip it appart and add calls to the WPF API's at the appropriate places in the code. All of the Harmony Swing/AWT code already compiles to .NET assemblies, it just isn't hooked into WPF yet. 

So, what is there. Well, enough of the core libraries (reflection, concurrency, class loading, io, nio charsets, etc.) are there that the Ja.NET SE tools (compiler, assembly merger, run on .NET. Also, I've got enough there that JUnit 4.3/4.5, Xerces 2.8, Ant 1.7.0 are working on .NET without any code changes. And, of course I'm adding more and more daily! :-)

Ja.NET currently runs on both Microsoft's CLR and Novell's Mono platform.

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • sounds similar to J#

    by peter lin,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    the project sounds very interesting. looks like an open source version of J#.

  • current release has some bugs

    by 董 平雷,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    Current release version ,can't run some big java software,etc:netbeans....

  • Re: sounds similar to J#

    by Ben Bowen,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    I think the big difference is that J# does not compile to Java Bytecode, so will not run on a JVM, where this compiles to Bytecode as well as MSIL so it can run in both envoronments. (from my understanding of this article)

  • Re: sounds similar to J#

    by Jonathan Allen,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    True. But if you are committed to writing JDK-compliant code, then you can safely recompile using a normal Java compiler.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p