tags:

views:

137

answers:

4

As of October 2010, is GNU's Java compiler dead? Are there any active alternatives (especially for compiling Java to native code)?

LLVM solutions would be preferred.

+1  A: 

You could use IKVM and Mono's ahead of time compiler to generate native code.

EDIT

There is an example at the bottom of this page.

mikerobi
IKVM does not create native code. It produce only another type of byte code for the .NET universe.
Horcrux7
@Horcrux7, read my answer more carefully and actually visit the link. Mono can generate native machine code from .NET bytecode. So in combination with IKVM, you can produce native code.
mikerobi
Obviously whoever is down voting me didn't read the OP or my answer, or doesn't believe me. Actually look at the link I provided. He asked for alternatives for native code generation, and that is what I gave him.
mikerobi
Ok, you means AOT http://www.mono-project.com/AOT. Yes, it produce some type of native code.
Horcrux7
@Horcrux7, AOT = ahead of time
mikerobi
+2  A: 

One alternative to compile Java to native is Excelsior JET.

Grodriguez
A: 

I think not that it is dead. It has only few important. Which result in a slow development. There are 3 fact because it has only few important today:

  • It based on the GNU Classpath. Since Java is open source (OpenJDK) there is no large need for another open source Java. This has slow down the development speed.
  • The Java was faster in the last years. The GCJ output is not faster. In many cases it is slower.
  • The GNU Classpath has many incompatibility.
Horcrux7
+1  A: 

If it isn't dead it is certainly lying down. 1.2 support is still incomplete. Ditto 1.3. The project was last updated over a year ago. Currently 'supports most of the 1.4 libraries plus some 1.5 additions.' Doesn't support java.nio. Doesn't support javax.naming ('complete but no providers'). Doesn't support javax.sql. Doesn't support AWT or Swing. Doesn't support localization via java.text. State of java.security is 'unknown'. Doesn't check permissions in java.lang.reflect. Does it compile generics? Huge chunks missing out of other packages, e.g. nearly 50% of java.util. No annotations. No script engine. Nearly all of javax.xml.* (recursively) is missing. No org.omg.CORBA. Practically no org.w3c. Current comparison with JDK 1.6 is here. Note that this appears to add percentages to give a total, which doesn't mean anything to me.

And note that it isn't billed as a 'Java compiler'. It is a compiler for a subset of Java known as GNU CLASSPATH. Which in turn hasn't been updated since Feb 2009.

IMO it is to be avoided.

EJP