I'm trying to install Java 8 on a GitLab Runner like this:

apt-get --quiet update --yes
apt-get --quiet upgrade --yes
apt-get --quiet install --yes software-properties-common python-software-properties
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
add-apt-repository ppa:webupd8team/java
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get --quiet update --yes
apt-get --quiet install --yes oracle-java8-installer oracle-java8-set-default

But I still get this error, which says a website can't be found:

W: Failed to fetch http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/jessie/main/binary-amd64/Packages  404  Not Found
  • Why did you tag your question as debian not ubuntu? – Tomasz Aug 11 '16 at 0:33
  • Because GitLab's Runners run on DigitalOcean CoreOS servers ;) – timbremer Aug 13 '16 at 21:20

I use moss/java_oracle for a java based GitLab runners. So I would recommend Docker containers for your runners since it's a much more elegant solution.

But if you still want to do this way, run:

    curl --silent --location --retry 3 --cacert /etc/ssl/certs/GeoTrust_Global_CA.pem \
    --header "Cookie: oraclelicense=accept-securebackup-cookie;" \
    http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.tar.gz \
    | tar xz -C /tmp && \
    mkdir -p /usr/lib/jvm && mv /tmp/jdk1.8.0_111 /usr/lib/jvm/java-8-oracle

This way you're downloading and unpacking Oracle Java.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.