InfoQ

News

Java 1.5 for the .NET Platform

Posted by Jonathan Allen on Dec 15, 2008

Community
.NET,
Java
Topics
Interop
Tags
Java SE

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 - www.janetdev.org). 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.

sounds similar to J# by peter lin Posted Dec 15, 2008 6:46 PM
Re: sounds similar to J# by Ben Bowen Posted Dec 16, 2008 10:39 AM
Re: sounds similar to J# by Jonathan Allen Posted Dec 16, 2008 5:03 PM
current release has some bugs by 平雷 董 Posted Dec 15, 2008 8:37 PM
  1. Back to top

    sounds similar to J#

    Dec 15, 2008 6:46 PM by peter lin

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

  2. Back to top

    current release has some bugs

    Dec 15, 2008 8:37 PM by 平雷 董

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

  3. Back to top

    Re: sounds similar to J#

    Dec 16, 2008 10:39 AM by Ben Bowen

    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)

  4. Back to top

    Re: sounds similar to J#

    Dec 16, 2008 5:03 PM by Jonathan Allen

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

Educational Content

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.