Java – The JDK is missing and is required to run some NetBeans modules

javajava-8jdk1.6netbeansopenjdk

Complete error message:
The JDK is missing and is required to run some NetBeans modules
Please use the –jdkhome command line option to specify a JDK installation or see http://wiki.netbeans.org/FaqRunningOnJre for more information.

Some details: I just installed Netbeans on Linux mint for the first time and when I start it when its turning on modules this error message appears. But I do have jdk installed.

$ java -version

java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

$ javac -version

javac 1.8.0_66

Best Answer

Find the file [netbeans installation directory]/etc/netbeans.conf

Luckily, Linux has a find helper like find /home/ -name "netbeans.conf, in which you can change the /home/ to a location where you want to search.

I found it at /usr/local/netbeans-8.1/etc/netbeans.conf

Once, you found the file, the following property needs to be set:

netbeans_jdkhome="[jdk_path]"

where you can find the jdk_path using:

update-alternatives --config java

In my case, I found it at /opt/java/jdk1.8.0_191