[macOS] NetBeans IDE cannot be installed. Java (JRE) found on your computer but JDK XX or newer is required.


Error:
NetBeans IDE cannot be installed.
Java (JRE) found on your computer but JDK 11 or newer is required. 
Please download and install the latest update of JDK 11 from 
http://www.oracle.com/technetwork/java/javase/downloads/index.html 
and restart NetBeans installation.

If you are using a macOS (Catalina, Big Sur e.t.c) and trying to use install and run Netbeans IDE and get the above error, then there are few steps you can try to fix this issue,

  1. Open the netbeans.conf file in Text Editor,
  2. Look for netbeans_jdkhome,
  3. Change its value to your Home dir of jdk,
  4. netbeans_jdkhome="/Library/Java/JavaVirtualMachines/jdk1.XX.X_XXX.jdk/Contents/Home"

  5. Restart your Mac device.

⚡️ You should fine the conf file under: /Applications/ NetBeans/ NetBeans XX.XX.app/ Contents/ Resources/ NetBeans/ etc/ netbeans.conf

Netbeans cannot be installed error - macOS
Netbeans cannot be installed error - macOS
❗️ If this does not work, you might have to reinstall Java, 
 I have often seen over the years that after upgrading macOS installed Java JDK being affected.