I have recently upgraded into MacOS Big Sur and when tried to open NetBeans 8.2 it gave an error
The JDK is missing and is required to run some NetBeans modules. Please use the --JDK home command-line option to specify a JDK installation
I tried setting JAVA_HOME to the JDK path but it didn't work. So, I uninstalled Netbeans and JDK and re-downloaded Netbeans 8.2 and JDK 8.
Now when trying to set up the Netbeans, it shows :
NetBeans IDE cannot be installed. Java (JRE) found on your computer but JDK 8 or newer is required. Please download and install the latest update of JDK 8 from http://www.oracle.com/technetwork/java/javase/downloads/index.html and restart NetBeans installation.
Java -version
java version "1.8.0_271"
Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)
Javac -version
javac 1.8.0_271
My current $JAVA_HOME is set to/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home
I also tried installing NetBeans 11 and 12 with JDK 14 and 15 but it gives the same error
EDIT: Following is the only solution that worked for me.
/Applications/NetBeans/Apache\ NetBeans\ 12.1.app/Contents/Resources/NetBeans/netbeans/bin/netbeans --jdkhome /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home
Paste the above command on terminal. It opens the NetBeans. To use the NetBeans without typing the command again save the above command on a code editor and save as NetBeans.command
file.
Then open the file. Click okay on the prompted message. Type following command on the terminal.
sudo passwd root
Type your login password.
Just press Enter (you don't have to type a new password)
Type su root
and your login password again.
Type chmod +x <path of the file you saved with .command>
. Quit the terminal and open the saved file. It should work now.
I had the same problem. I have not needed to restart the computer. I have simply changed the line:
netbeans_jdkhome="/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home"
in the file netbeans.conf, from the directory:
/Applications/NetBeans/NetBeans\ 8.2.app/Contents/Resources/NetBeans/etc/netbeans.conf
and this has worked for me