Programster's Blog

Tutorials focusing on Linux, programming, and open-source

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

If not there, it may be at /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

This blog is created by Stuart Page

I'm a freelance web developer and technology consultant based in Surrey, UK, with over 10 years experience in web development, DevOps, Linux Administration, and IT solutions.

Need support with your infrastructure or web services?

Get in touch