-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exec binary does not work on Java 9+ #133
Comments
FWIW, I couldn't reproduce the bug in CI and my local env (macOS 10.13.5, Java 9.0.1 & 1.8.0_131) 🤔 diff --git .travis.yml .travis.yml
index 00148b5..104dc56 100644
--- .travis.yml
+++ .travis.yml
@@ -4,16 +4,25 @@ cache:
directories:
- $HOME/.m2
jdk:
+ - oraclejdk10
- oraclejdk9
- oraclejdk8
+ - openjdk11
+ - openjdk10
+ - openjdk9
- openjdk8
- - openjdk7
env:
matrix:
- - VERSION='1.7'
- VERSION='1.8'
- VERSION='1.9'
-script: lein with-profile dev,$VERSION test
+ - VERSION='1.10'
+before_install:
+ - if [ -f "${JAVA_HOME}/lib/security/cacerts" -a -w "${JAVA_HOME}/lib/security/cacerts" ]; then rm "${JAVA_HOME}/lib/security/cacerts" && ln -s /etc/ssl/certs/java/cacerts "${JAVA_HOME}/lib/security/cacerts"; fi;
+script:
+ - lein with-profile dev,$VERSION test
+ - lein bin
+ - java -version
+ - target/cljam version
jobs:
include:
- stage: coverage |
On my environment (
but these patterns are tested the above CI config. umm... |
Oops! I forgot to specify Clojure verisons in the CI... 😵
It's now failing on Clojure 1.8 with Java 9+ |
Maybe this is related to CLJ-2077 clojure.core (defmacro ^:private when-class [class-name & body]
`(try
(Class/forName ^String ~class-name)
~@body
(catch ClassNotFoundException _#)))
(when-class "java.sql.Timestamp"
(load "instant")) |
That may be right. Leiningen <2.8 also had the same problem. :uberjar {:dependencies [[org.clojure/clojure "1.9.0"] just resolves this issue. |
or we can use Clojure 1.8 with Java 9+ by setting diff --git project.clj project.clj
index 7cfd6a1..e734624 100644
--- project.clj
+++ project.clj
@@ -30,7 +30,11 @@
:main ^:skip-aot cljam.tools.main
:global-vars {*warn-on-reflection* true}}
:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]}
- :1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}
+ :1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]
+ :bin {:jvm-opts ~(if (<= 9 (Integer/parseInt (re-find #"^\d+" (System/getProperty "java.version"))))
+ ["--add-modules" "java.sql"]
+ [])
+ :bootclasspath ~(> 9 (Integer/parseInt (re-find #"^\d+" (System/getProperty "java.version"))))}}
:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:1.10 {:dependencies [[org.clojure/clojure "1.10.0-alpha4"]]}
:uberjar {:dependencies [[org.clojure/clojure "1.9.0"] |
Yes, but that is more than necessary. It is simple and enough to create working binary with clojure 1.9. |
I agree 😃 |
@alumi Thanks! |
The text was updated successfully, but these errors were encountered: