Installing a specific JDK 11 environment for Maven builds

I need to configure our Maven-based builds to run with a version of Open JDK 11 that fixes this Race condition in TLS 1.3 session resumption issue, triggered by at least one repository we need to access.

Obviously I can temporarily use the workaround of disabling TLS 1.3, but that’s not sustainable in the long term.

All the commentary here, and elsewhere, about installing different JDK versions point to the script, but that doesn’t get me a build beyond 11.0.2 (the same one I get with jdk set to openjdk11 in our dot-travis file) because it really only looks in a properties file where someone has previously worked out the links.

Ideally I’d be able to use Amazon’s Corretto builds, for consistency with our local development environments.

What’s a good, efficient, maintainable, supported approach, to do this? We’re currently using the Xenial build environment, if that makes a difference.

Hey @jrg,

As you stated, is used by Travis internally, let’s say if you wanted to use 11.0.4, so you’ll need to specifically install AdoptOpenJDK 11.0.4 (Linux, HotSpot) since Travis does not offer it by default. This is a sample .travis.yml I have created.

        - wget -O /tmp/
        - >-
          source /tmp/
          --url ''
      script: >-
        mvn clean install -Pcontrib-check,jsUnitTests
        -Dmaven.surefire.arguments="-Duser.language=en -Duser.region=US"
        | grep -v -F -f .travis-output-filters
        && exit ${PIPESTATUS[0]}

There’s also something called SDKMAN, that some people have had success with I’ll ask some colleagues tomorrow to see if there’s a rational fix for this. Xenial should be just fine.