From 2e8cc150527906f7d9bd23658c96f5d4221fdcf9 Mon Sep 17 00:00:00 2001 From: Mitchell Hentges Date: Fri, 9 Nov 2018 13:41:37 -0800 Subject: [PATCH] Manually adds java 8 to front of $PATH for xenial Travis builds --- .travis.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1700b18..2dd4ac3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,17 +8,25 @@ matrix: - python: 3.6 env: TOXENV=py36 - JDK_SWITCH=openjdk7 + before_install: + - jdk_switcher use openjdk7 - python: 3.7 # from https://github.com/travis-ci/travis-ci/issues/9815#issuecomment-401756442 dist: xenial env: TOXENV=py37 JDK_SWITCH=openjdk8 + before_install: + # xenial doesn't ship with jdk_switcher + - wget https://raw.githubusercontent.com/michaelklishin/jdk_switcher/7e512921ba5a6e93ce304683f099e3c0525330b1/jdk_switcher.sh + - source ./jdk_switcher.sh + - jdk_switcher use openjdk8 + # Travis' xenial image hard-codes "openjdk11" into the path - if we want Java 8, we need to + # manually insert it into the beginning of the path + - export PATH="/usr/lib/jvm/java-8-openjdk-amd64/bin:$PATH" install: - travis_retry pip install tox - - jdk_switcher use "${JDK_SWITCH}" script: - java -version - tox -e "$TOXENV"