We could use this script to install jdks:
https://github.com/sormuras/bach#install-jdksh
When user specifies in jitpack.yml:
jdk:
- openjdk10
Regarding setting JAVA_HOME, there are 3 ways to get/set JAVA_HOME from/to install-jdk.sh:
Source install-jdk.sh into current shell to install latest OpenJDK and let it update JAVA_HOME and PATH environment variables:
source ./install-jdk.sh _Caveat: if an error happens during script execution the calling shell will terminate_Provide target directory path to use as JAVA_HOME:
JAVA_HOME=~/jdk && ./install-jdk.sh --target $JAVA_HOME && PATH=$JAVA_HOME/bin:$PATHRun install-jdk.sh in a sub-shell to install latest OpenJDK and emit the installation path to stdout:
JAVA_HOME=$(./install-jdk.sh --silent --emit-java-home)JAVA_HOME=$(./install-jdk.sh --emit-java-home | tail --lines 1)Hi all,
Both jdk 10 and 11 should now be available out of the box.
jdk: openjdk10 and jdk: openjdk11?
jdk: openjdk11 works. 馃憤
https://javadoc.jitpack.io/com/github/sormuras/bach/master-431adb24ff-1/build.log
What do I need to do in build.gradle to make java 11 work? Java 8 works correctly. I changed the source and target compatibility in build.gradle to java 11 and the build fails.
What went wrong:
Execution failed for task ':compileJava'.
> Could not target platform: 'Java SE 11' using tool chain: 'JDK 8 (1.8)'
The build log is here
According to https://jitpack.io/docs/BUILDING/#java-version a Gradle-based build requires the [.]jitpack.yml configuration file:
jdk: openjdk11
Thanks. I thought I there was something missing in build.gradle