Closed tsachev closed 5 years ago
This is biting me right now too. Maven is compiling under JDK 11, configured via JAVA_HOME
, but my default runtime is Java 8 and that's what clojure-maven-plugin
is picking up. Everything compiles fine, but then any call into Clojure code blows up at runtime with IncompatibleClassChangeError
errors due to byte code incompatibility.
All being well a new release should be winging its way out tonight:
env JAVA_HOME=/Users/amrk/Applications/jdk-12+33/Contents/Home \
mvn com.theoryinpractise:clojure-maven-plugin:compile -X
now yields:
[DEBUG] Command line: [/Users/amrk/Applications/jdk-12+33/Contents/Home/bin/java, \
-Dclojure.compile.path=/var/folders/2h/76nn14b502q410szcd74lv200000gn/T/classes662961663364622820.dir, -jar, .....
Awesome!! Thank you for the quick fix here.
Currently the only why to tell the clojure compiler which java executable to use is to put it on the class path or use maven toolchains.
if my path points to a
java
that I do not want to use for some reason (say java 9), I want to be able to run maven with for e.g.This will run maven with the java 8, but the clojure compiler with java 9.
Another option would be to have a javaHome property in the compiler mojo that I could set with -D like