Clojure 1.9 (and 1.8, and every other prior version of Clojure!) works with 
Java 9 due to the care that Java takes in retaining backward compatibility. 
Clojure 1.0 works just fine with Java 9.

However, there have been some changes that affect various tools, most 
prominently Leiningen and Boot. Leiningen has for a long time put the 
Clojure jar on the bootclasspath to make startup a little faster. Due to 
the new classloader and base module constraints, this doesn't work in Java 
9 due to the use of a class outside the Java base module in core. In 
Clojure 1.9.0-beta1 we started lazy loading the code using the problematic 
class to sidestep this specific case. Also, Leiningen has made changes such 
that there is more flexibility in whether you put Clojure on the 
bootclasspath. Depending which version of lein and Clojure you are using, 
you may see this issue. I'd recommend using the latest version of both lein 
and Clojure to avoid it.

There have also been changes in the standard classloader hierarchy in Java 
9 that affect some of the dynamic classloader libraries (like dynapath, 
used by Leiningen and Boot). Those issues have been addressed but if you 
have an older version of any of those you can encounter those problems.

There is a known issue related to the new module system in JDK9 and how 
Clojure chooses a method in a reflective call, in particular the Reflector 
may choose to invoke a module-private method of an implementation rather 
than the visible interface method. This violates the module system's 
constraints and throws an IllegalAccessException (see CLJ-2066). This will 
not be addressed in Clojure 1.9, but is easily worked around by type 
hinting the call target to avoid reflection. I expect this will be 
addressed in the next release; the changes are significant enough that it 
seemed too risky (for all other reflective calls) to change right before 
the release.


On Friday, November 10, 2017 at 12:48:01 PM UTC-6, Didier wrote:
>
> Is Clojure 1.9 expected to support JDK9? Or is that support reserved for a 
> later version?
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to