Skip to content

Instantly share code, notes, and snippets.

@mariorez
Last active August 29, 2015 14:00
Show Gist options
  • Save mariorez/0ae8366bf86d0e29d1e7 to your computer and use it in GitHub Desktop.
Save mariorez/0ae8366bf86d0e29d1e7 to your computer and use it in GitHub Desktop.
# Download the latest Java SE SDK version.
http://www.oracle.com/technetwork/java/javase/downloads/index.html
# Untar the Archive:
tar -xzvf jdk-8-linux-x64.tar.gz
mv jdk1.8.0 /opt
cd /opt/jdk1.8.0
# This step registers the downloaded version of Java as an alternative, and switches it to be used as the default:
update-alternatives --install /usr/bin/java java /opt/jdk1.8.0/bin/java 1
update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0/bin/javac 1
update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.8.0/jre/lib/amd64/libnpjp2.so 1
update-alternatives --set java /opt/jdk1.8.0/bin/java
update-alternatives --set javac /opt/jdk1.8.0/bin/javac
update-alternatives --set mozilla-javaplugin.so /opt/jdk1.8.0/jre/lib/amd64/libnpjp2.so
# To check the version of Java you are now running
java -version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment