Skip to content

Commit

Permalink
Try travis_java_install script from pywrangler
Browse files Browse the repository at this point in the history
  • Loading branch information
dpkp committed Mar 13, 2019
1 parent 38c7d08 commit 0a73b18
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ cache:
- servers/

before_install:
- source travis_java_install.sh
- ./build_integration.sh

install:
Expand Down
22 changes: 22 additions & 0 deletions travis_java_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# borrowed from: https://github.com/mansenfranzen/pywrangler/blob/master/tests/travis_java_install.sh

# Kafka requires Java 8 in order to work properly. However, TravisCI's Ubuntu
# 16.04 ships with Java 11 and Java can't be set with `jdk` when python is
# selected as language. Ubuntu 14.04 does not work due to missing python 3.7
# support on TravisCI which does have Java 8 as default.

# show current JAVA_HOME and java version
echo "Current JAVA_HOME: $JAVA_HOME"
echo "Current java -version:"
java -version

# install Java 8
sudo add-apt-repository -y ppa:openjdk-r/ppa
sudo apt-get -qq update
sudo apt-get install -y openjdk-8-jdk --no-install-recommends
sudo update-java-alternatives -s java-1.8.0-openjdk-amd64

# change JAVA_HOME to Java 8
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

0 comments on commit 0a73b18

Please sign in to comment.