I'm having trouble building, and I believe I've fo...
# kontributors
a
I'm having trouble building, and I believe I've followed all of the instructions right, but every time I try to run
coreLibsTest
I get this:
> Could not target platform: 'Java SE 10' using tool chain: 'JDK 8 (1.8)'.
I set all of the environment variables:
Copy code
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin
JDK_16=/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin
JDK_17=/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin
JDK_18=/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin
JDK_9=/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/bin
Anyone have a hunch at what I might be doing wrong that it's trying to target Java 10?
i
Could you provide details on the task that reports that error? You can run the build with
--scan
option, and paste a link to the generated build scan here.
a
Yeah I can, one moment. The task was
Execution failed for task ':compiler:util:compileJava'.
That was from doing
./gradlew clean build
. I get the same error when I ran
coreLibsTest
but this time it failed on
:tools:binary-compatibility-validator:compileTestJava
i
According to the "Infrastructure" tab Gradle still runs on Java 10. Do you start these tasks from the command line? Could you check that you have no
org.gradle.java.home
property overridden in your local
gradle.properties
?
I also think you should not append
bin
to the paths. JDK is not only the binaries, so JDK Home is not where the binaries are, but one level upper.
a
Sorry just seeing this. Confirmed there's no property in my local properties file. Will try changing the paths and see if that was the issue.
I actually just checked my old laptop, where this has worked, and I set the paths to end after
.jdk
so let me try that really quick could be that simple.
Hmm it's still happening. I was using the command line but let me try from intellij.
i
Try setting JAVA_HOME as
/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
a
Yeah I just did haha your question inspired me to put it there and just assign it to the one I want.
It hasn't failed yet, but it's run longer than normal. I'll come back and let you know if it works.
Yeah that was it. Not sure why gradle was running with Java 10, but overriding it in my local
gradle.properties
to point to JDK 8 was fine. Thanks for the help, @ilya.gorbunov