Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# First copy extracted JDK folder to /usr/lib/jvm. (JAVA 7, 8, 9, 10, 11 .tar.gz files)
cd /usr/lib/jvm
ls -al
lrwxrwxrwx 1 root root 25 Jan 28 2018 default-java -> java-1.11.0-openjdk-amd64
lrwxrwxrwx 1 root root 21 Jan 28 2018 java-1.11.0-openjdk-amd64 -> java-11-openjdk-amd64
drwxr-xr-x 7 root root 4096 Jul 17 18:20 java-11-openjdk-amd64
drwxrwxr-x 8 test test 4096 Aug 14 23:50 jdk-10.0.2
drwxr-xr-x 8 668 668 4096 Sep 29 15:00 jdk-11
drwxr-xr-x 7 test test 4096 Jul 7 13:39 jdk1.8.0_181
sudo update-alternatives --install "/usr/bin/java" java "/usr/lib/jvm/jdk1.8.0_181/bin/java" 1
sudo update-alternatives --install "/usr/bin/java" java "/usr/lib/jvm/jdk-11/bin/java" 2
sudo update-alternatives --install "/usr/bin/java" java "/usr/lib/jvm/jdk-10.0.2/bin/java" 3
sudo update-alternatives --list java
/usr/lib/jvm/java-11-openjdk-amd64/bin/java
/usr/lib/jvm/jdk-10.0.2/bin/java
/usr/lib/jvm/jdk-11/bin/java
/usr/lib/jvm/jdk1.8.0_181/bin/java
sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_181/bin/java
java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
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.