#!/bin/bash

fw_installed java && return 0

# TODO: Someday get away from apt-get
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
sudo apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y oracle-java8-installer

# Setup environment variables
JAVA_HOME=/usr/lib/jvm/java-8-oracle
echo "export JAVA_HOME=${JAVA_HOME}" > $IROOT/java.installed
echo -e "export PATH=\$JAVA_HOME/bin:\$PATH" >> $IROOT/java.installed

source $IROOT/java.installed

#!/bin/bash

fw_installed java && return 0

# TODO: Someday get away from apt-get
sudo add-apt-repository -y ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk

# Setup environment variables
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
echo "export JAVA_HOME=${JAVA_HOME}" > $IROOT/java.installed
echo -e "export PATH=\$JAVA_HOME/bin:\$PATH" >> $IROOT/java.installed

source $IROOT/java.installed

Use OpenJDK instead of the Oracle JDK
Use OpenJDK instead of the Oracle JDK

The oracle-java8-installer package is currently failing with a 404 error.
We found workarounds to fix the installer but they seem more complicated
than using OpenJDK instead.

We don't think that anything in TFB actually depends on something that's
in the Oracle JDK and not in OpenJDK such that test implementations would
start to fail.  If there are test implementations like that, we should
probably fix them so that they aren't like that.

We're asserting that there will be no difference in performance.

Looking ahead to the future, Oracle provides OpenJDK 9 in .tar.gz form
(at http://jdk.java.net/9/), which we would prefer to use instead of apt.
We're going to upgrade Java versions eventually, so we'd probably switch
to OpenJDK then for the .tar.gz convenience even if we didn't switch now.
