Jitpack.io: Support JDK 10 and 11

Created on 26 Apr 2018  路  7Comments  路  Source: jitpack/jitpack.io

We could use this script to install jdks:
https://github.com/sormuras/bach#install-jdksh

When user specifies in jitpack.yml:

jdk:
- openjdk10
enhancement

All 7 comments

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:$PATH
  • Run 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)

https://github.com/sormuras/bach#install-jdksh

Hi all,

Both jdk 10 and 11 should now be available out of the box.

jdk: openjdk10 and jdk: openjdk11?

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SilenceDut picture SilenceDut  路  4Comments

jitpack-io picture jitpack-io  路  4Comments

bsideup picture bsideup  路  4Comments

mattcg picture mattcg  路  4Comments

leahjlou picture leahjlou  路  4Comments