Clojure only depends on Java 1.5?

I hope this is not off topic for SO (I hesitated between SO and programers.stackexchange), but as far as I can tell, this is a “practical, responsible problem that is unique to the programming profession”, so it matches the FAQ.

What version of the JVM do you need to run the version of Clojure (Clojure on the JVM, this question is not about ClojureScript)?

The page here: http://clojure.org/getting_started claims to:

Clojure only requires Java 1.5 or higher

But is this always the case?

What about the Clojure ecosystem like Leiningen?

Basically, I would like to know if I can rely on Clojure to be able to develop a desktop application that should run on systems, including OS X systems, which will never receive Java 6 and later versions of Java (for example, in some versions OS X Apple said no JVM 6 will ever see the light).

+6
source share
3 answers

I am not in the Clojure / core team, so I don’t have inside information, but here’s how I could approach this situation.

Take the latest version of Clojure (1.5 at the time of this writing) and test it against Java 1.5 for what you need to do and any Clojure libraries you need to use and stick to this. If Clojure 1.5 is compatible with Java 1.5, it will always be that way, since this version is unchanged.

I would not assume that all versions of Clojure after 1.5 will be compatible with Java 1.5, and you definitely cannot assume that there will be Clojure libraries. For example, I just released the Clojure library, which requires Java 1.7 (since it uses the java.util.concurrent class introduced in Java 1.7).

Since Leiningen gives you permission to use maven-like, if you test all your libraries and your chosen version of Clojure in Java 1.5 and they work, then you can stick to this set of version-dependent dependencies for as long as you want to maintain the application. Your only risk at that time is that some bug fixes in the non-core library may not be compatible with Java 1.5. This risk is proportional to the number of non-core Clojure libraries that you need to use.

+5
source

If you choose which libraries you use, then targeting in Java 1.5 is certainly possible .

  • Clojure is very conservative with regard to the requirements for the Java version - it depends on version 1.5 only.
  • Many libraries depend only on Clojure itself, so they will work quite happily on the 1.5 JVM
  • Some libraries require> 1.5, which are usually more complex libraries that have requirements for interacting with certain Java functions (for example, the newer concurrency).

Note I personally write all my applications / libraries for targeting in Java 1.6, since I think this is a reasonable minimum, and the vast majority of Java-based systems are 1.6 or higher. I am ready to live with the potential loss of several users who are stuck on 1.5. In addition, even if a future version of Clojure abandons 1.5, I expect it to continue to support Java 1.6 for a long time.

+3
source

It is noteworthy that in Clojure 1.6 they pushed the version of Java to 1.6:

Clojure Release Notes 1.6 include this ticket: CLJ-1268: Require Java 1.6 at least for Clojure

So, “ no ” is the answer to the original post question: “But is there [Clojure only requires Java 1.5 or higher]?”

0
source

All Articles