40

截至 2010 年 10 月,GNU 的 Java 编译器已经死了吗?是否有任何有效的替代方案(尤其是将 Java 编译为本机代码)?

LLVM 解决方案将是首选。

4

4 回答 4

27

您可以使用IKVMMono的提前编译器来生成本机代码。

编辑

本页底部有一个示例。

于 2010-10-27T16:41:55.297 回答
24

A more pertinent question would be whether it was ever really alive. Consider these issues, from its own website:

  • 1.2 support is 'still incomplete'.
  • 1.3 ditto.
  • The project was last updated over a year ago [as of October 2009].
  • 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 completely meaningless total.

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.

If it isn't dead it is certainly lying down.

EDIT It's dead. GCJ is no longer listed as a GNU package. And after four years of zero activity we are entitled to assume the same about GNU CLASSPATH.

于 2010-10-28T06:39:20.037 回答
5

将 Java 编译为本机的一种替代方法是Excelsior JET

于 2010-10-27T16:54:40.290 回答
1

我不认为它已经死了。它只有几个重要的。从而导致发展缓慢。有 3 个事实,因为它今天只有几个重要的:

  • 它基于 GNU 类路径。由于 Java 是开源的(OpenJDK),因此不需要另一个开源 Java。这减缓了开发速度。
  • Java 在过去几年中速度更快。GCJ 输出并不快。在许多情况下,它比较慢。
  • GNU 类路径有很多不兼容之处。
于 2010-10-27T19:04:07.437 回答