1

当我将 Clojure 与 (Sun/Oracle) Hotspot VM 一起使用时,Clojure 至少需要哪些其他软件组件?所有这些(最小)组件都是开源的吗?

我看到Hotspot VM 是开源的,但我认为该组件中不包含任何 Java 库。例如,我知道 Clojure 需要 Java 字符串和正则表达式。

4

2 回答 2

1

There's good news and bad news and good news.

  • The Oracle distributions of Java includes the full Java SE libraries. In fact, any Java distribution does.

  • But ... the Oracle distributions is not totally open source. Certainly, the source code bundle that is included in a Java 7 Hotspot JDK says this in the source code headers:

Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.

  • But ... Oracle distributions are built from a source code base that is derived from OpenJDK, and OpenJDK is fully Open Source.

So if you want to see the Java SE source code, and the source code of the JVM, it is pretty much all in the OpenJDK repositories. It is possible that there is a bit of "secret sauce/source" for Hotspot that is held back, but I'm not aware of any public details.

And if you want to be 100% kosher OSS, you have the option of using an OpenJDK-based distribution; e.g. as available for most recent Linux distros from their respective package installer repositories. You could also download and build the source from the OpenJDK repositories.


When I use Clojure with the (Sun/Oracle) Hotspot VM, what other software components are required, at a minimum, by Clojure?

The complete Java SE libraries. I don't think you can subset the library because a Clojure program could use any of the standard Java classes. (And if you did try to subset the Java standard libraries you'd have to analyse all of Clojure and its standard libraries to figure out what subset of Java is required. And it would most likely be a moving target.)

Are all those (minimal) components Open Source?

Strictly speaking, it depends on where you get them from.

于 2013-04-28T15:31:55.673 回答
0

OpenJDK 的构建——无论是从 Linux 发行版预构建的,例如 RedHat 的 IcedTea,还是从源代码手工构建(使用新的 build-infra 构建是微不足道的——有关详细信息,请参阅 AdoptOpenJDK)是运行 Clojure 所需的全部。

您不应该尝试对 Java 类库进行子集化——这将在以后给您带来很大的痛苦,而实际上收益为零。

于 2013-05-06T11:18:21.393 回答