Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
wget oracle jdk
wget --no-check-certificate \
--no-cookies \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \ \
-O jdk-7u45-linux-x64.rpm
wget --no-check-certificate \
--no-cookies \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \ \
-O jdk-7u45-linux-x64.tar.gz
# Make sure that you have the correct download url from
# cURL alternate
# where,
# -L | --location; Required for cURL to redirect through all the mirrors
# -C / --continue-at -; cURL requires the dash (-) in the end
# -O; Required for cURL to save files
# -b / --cookie "oraclelicense=accept-securebackup-cookie"; same as -H/--header "Cookie: ..."
curl -L -C - -b "oraclelicense=accept-securebackup-cookie" \
# Optional, using alternatives to update the JDK to use
# add's a symbolic link to the Oracle JDK installation so that your system uses the Oracle JDK instead of the OpenJDK (if installed)
alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_45/bin/java 200000
# If there are more than on version of java, then tell alternatives to switch (enter approprate number matching the latest installation of JDK)
alternatives --config java
# Update the JAVA_HOME and PATH so that users get the proper installation
cat > /etc/profile.d/ <<EOF
export JAVA_HOME=/usr/java/latest
export PATH="$PATH:${JAVA_HOME}/bin"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.