Skip to content

Instantly share code, notes, and snippets.

@isapir
Last active April 16, 2017 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isapir/edd83ee025ce0e04b5f6eef288131c60 to your computer and use it in GitHub Desktop.
Save isapir/edd83ee025ce0e04b5f6eef288131c60 to your computer and use it in GitHub Desktop.
## URL_BASE is found by inspecting the link at http://www.oracle.com/technetwork/java/javase/downloads/server-jre8-downloads-2133154.html
DIR_DOWNLOAD=~/Downloads
DIR_DEST=/usr/java
URL_BASE=http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441
## download server-jre
JAVA_ARCHIVE=server-jre-8u121-linux-x64.tar.gz
## to download JDK instead, use:
## JAVA_ARCHIVE=jdk-8u121-linux-x64.tar.gz
wget --timestamping --directory-prefix=$DIR_DOWNLOAD --header "Cookie: oraclelicense=accept" $URL_BASE/$JAVA_ARCHIVE
## extract archive
tar --directory $DIR_DEST -zxvf $DIR_DOWNLOAD/$JAVA_ARCHIVE
## server-jre is now at /usr/java/{version}/jre/bin/java, e.g. /usr/java/jdk1.8.0_121/jre/bin/java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment