Question

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

I see that the Hotspot VM is Open Source but I don't think any Java libraries are included in that component. I know Clojure needs Java strings and regular expressions for instance.

Was it helpful?

Solution

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.

OTHER TIPS

A build of OpenJDK - either prebuilt from a Linux distro, such as RedHat's IcedTea, or built by hand from source (which with the new build-infra build is trivial - see AdoptOpenJDK for details) is all that you need to run Clojure.

You should not attempt to subset the Java class libraries - this will cause you a great deal of pain later for essentially zero benefit.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top