Installing Java 1.8 JDK for JetBrains IntelliJ IDEA on Linux Mint 19.1

in #technology6 years ago

What did not work was installing the default JDK 11 .deb file from:
https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html
My interpretation is that this file creates a JVM folder in /usr/lib/jvm but no JDK folder that IntelliJ can recognize.

What did work is this tutorial:
https://community.linuxmint.com/tutorial/view/1372

I will summarize.

1> Remove any openjdk installations you might have:

$ sudo apt update && sudo apt remove openjdk-*
$ sudo apt autoremove # optional removal of leftover crap

..
2> Get jdk-8u201-linux-x64.tar.gz from:
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

3> Make a new java directory in /opt:

$ sudo mkdir -p /opt/java

..
4> Move and extract the jdk-8u201-linux-x64.tar.gz file:

$ sudo mv ~/Downloads/jdk-8u201-linux-x64.tar.gz /opt/java/
$ sudo tar zxvf jdk-8u201-linux-x64.tar.gz

..
5> Make the new Java JDK system default:

$ sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/jdk1.8.0_201/bin/java" 1
$ sudo update-alternatives --set java /opt/java/jdk1.8.0_201/bin/java

Done!

$ java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

..
Workspace Screenshot: