Netbeans - Change Java
I had initially downloaded the minimal version of Netbeans for PHP. It turns out this came bundled with its own JRE so that it could run even if you didn't have Java set up. This meant that when I tried to download the Java plugins to perform some Java development, Netbeans complained that I hadn't got a JDK set up. It turns out that I had already got a JDK set up on my machine, through the WebUpd8 Oracle installation package, I just needed to tell Netbeans to use that instead.
Steps
Edit the netbeans configuration file:
editor $HOME/netbeans-8.2/etc/netbeans.conf
/usr/local/netbeans-8.2/etc
Find the following line:
netbeans_jdkhome="/home/stuart/netbeans-8.2/bin/jre"
Change it to your version, e.g. for me it was:
netbeans_jdkhome="/usr/lib/jvm/java-8-oracle"
Last updated: 30th June 2021
First published: 16th August 2018
First published: 16th August 2018