'Java not found error when loading Apache Netbeans 9.0 or 10

I downloaded the archive for the program, unzipped it to C drive on Windows, then when I try to run either executable (32bit/64bit) in the bin folder I get the error message:

Cannot find JAVA 1.8 or higher.

in spite of Java 10 (JRE) being already installed. I also tried Installing Java 9 but was stuck with the same message.

I appreciate your help with this, Thanks.



Solution 1:[1]

Locate your Netbeans installation and in it the etc/netbeans.conf file. Open it with any text editor, and locate the line containing netbeans_jdkhome. If it is commented out (line starts with #), then remove the # to enable the setting. Then, set the value to the path to your JDK. This might be somethiing like C:\Program Files\Java\jdk-10.0.1.

Try to run the program again, it should work now. At least, it did for me.


Also, ensure that you installed the Java Development Kit (JDK), not only the Java Runtime Environment (JRE). Netbeans needs the former to be installed in order to function.

Solution 2:[2]

I experienced the issue after I updated Java and the version changed but the netbean.conf had the older version which is invalid.

The remedy is go into that file via notepad, or any text editor and then update the path with the correct version number, i.e. netbeans_jdkhome="C:\Program Files\Java\jre1.8.0_311".

You would go determined your latest Java edition, by pulling up the Java control panel and then hit the middle "Java" tab, hit "View" to see the current version you have installed.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Just a student
Solution 2 Henry Ecker