Unable to install JDK 8 on macOS 11.2 with dist: trusty

I’m trying to update a build that was previously using osx_image: xcode9.3 but now requires macOS 11. I’ve updated the version to xcode11.2 and noticed that JDK 8, which my build relies on, is not available anymore from xenial, so I switched to dist: trusty. However, the build is still failing with the following error:

Installing oraclejdk8
$ export JAVA_HOME=~/oraclejdk8
$ export PATH="$JAVA_HOME/bin:$PATH"
$ ~/bin/install-jdk.sh --target "/Users/travis/oraclejdk8" --workspace "/Users/travis/.cache/install-jdk" --feature "8" --license "BCL"
Ignoring license option: BCL -- using GPLv2+CE by default
install-jdk.sh 2019-10-16
Expected feature release number in range of 9 to 14, but got: 8
The command "~/bin/install-jdk.sh --target "/Users/travis/oraclejdk8" --workspace "/Users/travis/.cache/install-jdk" --feature "8" --license "BCL"" failed and exited with 3 during .

Build: https://travis-ci.org/square/okio/builds/615967582
.travis.yml: https://github.com/square/okio/blob/48906364e673b7f130e2bb0232d8ef1e5b386a3e/.travis.yml

Appreciate any help in figuring this out.

Hello @Egorand,

Have you tried migrating to OpenJDK?

@Montana yes, I have, it didn’t work. I managed to work around it by installing the JDK manually using Homebrew. Here’s the resulting .yml: https://github.com/square/wire/blob/master/.travis.yml

FYI dist: has no effect for OSX, it’s only for Linux.