Run the installer with the -is:javahome option.

If you believe you have the JDK installed properly, but the installer seems to fail to recognize it, you can try to run the installer with the -is:javahome option and specify the path to the JDK you want the installer to use.

Source: NetBeans User FAQ