This write-up assumes Ubuntu 18.04 or similar, with OpenJDK installed
jacek@jacek-ixtreme-M5850:~/Desktop$ ls -al /usr/bin/java lrwxrwxrwx 1 root root 22 Jul 9 20:09 /usr/bin/java -> /etc/alternatives/java jacek@jacek-ixtreme-M5850:~/Desktop$ ls -al /etc/alternatives/java lrwxrwxrwx 1 root root 43 Jul 9 20:09 /etc/alternatives/java -> /usr/lib/jvm/java-11-openjdk-amd64/bin/java
Inspired by the following but without using PPA. https://medium.com/coderscorner/installing-oracle-java-8-in-ubuntu-16-10-845507b13343
https://www.oracle.com/technetwork/java/javase/downloads/index.html
That will result in a file like this ~/Downloads/jdk-8u181-linux-x64.tar.gz
jacek@jacek-ixtreme-M5850:~/Desktop$ cd /usr/lib/jvm/ jacek@jacek-ixtreme-M5850:/usr/lib/jvm$ sudo cp ~/Downloads/jdk-8u181-linux-x64.tar.gz . jacek@jacek-ixtreme-M5850:/usr/lib/jvm$ ls default-java java-11-openjdk-amd64 java-1.11.0-openjdk-amd64 jdk-8u181-linux-x64.tar.gz jacek@jacek-ixtreme-M5850:/usr/lib/jvm$ sudo tar -xvzf ./jdk-8u181-linux-x64.tar.gz jacek@jacek-ixtreme-M5850:/usr/lib/jvm$ ls default-java java-11-openjdk-amd64 jdk-8u181-linux-x64.tar.gz java-1.11.0-openjdk-amd64 jdk1.8.0_181 jacek@jacek-ixtreme-M5850:/usr/lib/jvm$ sudo rm ./jdk-8u181-linux-x64.tar.gz
jacek@jacek-ixtreme-M5850:/usr/lib/jvm$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_181/bin/java 2 jacek@jacek-ixtreme-M5850:/usr/lib/jvm$ sudo update-alternatives --list java /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/lib/jvm/jdk1.8.0_181/bin/java jacek@jacek-ixtreme-M5850:/usr/lib/jvm$ sudo update-alternatives --config java and select the version you need jacek@jacek-ixtreme-M5850:/usr/lib/jvm$ java -version
edit the environment
sudo nano /etc/environment
and add the following line
JAVA_HOME="/usr/lib/jvm/jdk1.8.0_181"
Go to this page and click Download https://netbeans.org/
At the time of writing it has sent me to: https://netbeans.apache.org/download/nb90/nb90.html
that has let me to download a zip file.
Uncompressing the file and going to the bin directory lets you run netbeans.