Skip to content

Commit

Permalink
Manually adds java 8 to front of $PATH for xenial Travis builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitchell Hentges committed Nov 9, 2018
1 parent 91aaa35 commit 2e8cc15
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .travis.yml
Expand Up @@ -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"
Expand Down

0 comments on commit 2e8cc15

Please sign in to comment.