netbeansnetbeans-12

NullPointerException when trying to uninstall NetBeans 12.0


I'm trying to uninstall NetBeans 12.0, but the wizard throws the following exception at startup:

Exception: java.lang.NullPointerException: null

The log says this:

[2020-08-11 14:03:20.249]:     initializing product registry properties
[2020-08-11 14:03:20.249]:     exiting -- org.netbeans.installer.product.Registry.initializeRegistry():170
[2020-08-11 14:03:20.253]:     ... loading registry from file:/C:/Users/Kai/.nbi/registry.xml
[2020-08-11 14:03:20.311]:     entering -- org.netbeans.installer.product.Registry.loadProductRegistry():981
[2020-08-11 14:03:20.312]:     validating previous installations
[2020-08-11 14:03:20.378]:         NameResolver - to parse C:\Program Files\NetBeans 8.2
[2020-08-11 14:03:20.392]:         NameResolver - to parse C:\Program Files\NetBeans-12.0
[2020-08-11 14:03:20.396]:         NameResolver - to parse C:\Program Files\NetBeans-12.0
[2020-08-11 14:03:20.404]:         NameResolver - to parse C:\Program Files\NetBeans 8.2\bin\jre
[2020-08-11 14:03:20.407]:         NameResolver - to parse C:\Program Files\NetBeans-12.0
[2020-08-11 14:03:20.410]:         NameResolver - to parse C:\Program Files\NetBeans-12.0
[2020-08-11 14:03:20.414]:         NameResolver - to parse C:\Program Files\NetBeans-12.0
[2020-08-11 14:03:20.417]:         NameResolver - to parse C:\Program Files\NetBeans-12.0
[2020-08-11 14:03:20.424]:         NameResolver - to parse C:\Program Files\NetBeans 8.2
[2020-08-11 14:03:20.425]:     ... validating installations finished
[2020-08-11 14:03:20.425]:     exiting -- org.netbeans.installer.product.Registry.loadProductRegistry():981
[2020-08-11 14:03:20.425]:     ... loading registry from resource:data/registry.xml
[2020-08-11 14:03:20.434]:     entering -- org.netbeans.installer.product.Registry.loadProductRegistry():981
[2020-08-11 14:03:20.434]:     validating previous installations
[2020-08-11 14:03:20.434]:         NameResolver - to parse C:\Program Files\NetBeans 8.2
[2020-08-11 14:03:20.435]:         NameResolver - to parse C:\Program Files\NetBeans-12.0
[2020-08-11 14:03:20.437]:         NameResolver - to parse C:\Program Files\NetBeans-12.0
[2020-08-11 14:03:20.437]:         NameResolver - to parse C:\Program Files\NetBeans 8.2\bin\jre
[2020-08-11 14:03:20.438]:         NameResolver - to parse C:\Program Files\NetBeans-12.0
[2020-08-11 14:03:20.439]:         NameResolver - to parse C:\Program Files\NetBeans-12.0
[2020-08-11 14:03:20.440]:         NameResolver - to parse C:\Program Files\NetBeans-12.0
[2020-08-11 14:03:20.441]:         NameResolver - to parse C:\Program Files\NetBeans-12.0
[2020-08-11 14:03:20.442]:         NameResolver - to parse C:\Program Files\NetBeans 8.2
[2020-08-11 14:03:20.443]:     ... validating installations finished
[2020-08-11 14:03:20.443]:     exiting -- org.netbeans.installer.product.Registry.loadProductRegistry():981
[2020-08-11 14:03:20.447]:     An unexpected exception happened in thread Thread-2
[2020-08-11 14:03:20.448]:     java.lang.NullPointerException
[2020-08-11 14:03:20.448]:      at org.netbeans.installer.utils.helper.Version.equals(Version.java:69)
[2020-08-11 14:03:20.448]:      at org.netbeans.installer.product.Registry.changeStatuses(Registry.java:600)
[2020-08-11 14:03:20.448]:      at org.netbeans.installer.product.Registry.initializeRegistry(Registry.java:184)
[2020-08-11 14:03:20.448]:      at org.netbeans.installer.wizard.components.actions.InitializeRegistryAction.execute(InitializeRegistryAction.java:53)
[2020-08-11 14:03:20.448]:      at org.netbeans.installer.wizard.components.actions.netbeans.NbInitializationAction.execute(NbInitializationAction.java:69)
[2020-08-11 14:03:20.448]:      at org.netbeans.installer.wizard.components.WizardAction$1.run(WizardAction.java:103)
[2020-08-11 14:03:20.448]:     ... show message dialog
[2020-08-11 14:03:20.448]:         title: Critical Error
[2020-08-11 14:03:20.448]:         message: An unexpected exception happened in thread Thread-2
[2020-08-11 14:03:20.449]:         
[2020-08-11 14:03:20.449]:         Exception:
[2020-08-11 14:03:20.449]:           java.lang.NullPointerException:
[2020-08-11 14:03:20.449]:           null
[2020-08-11 14:03:20.449]:         
[2020-08-11 14:03:20.449]:         You can get more details about the issue in the installer log file:
[2020-08-11 14:03:20.449]:          C:\Users\Kai\.nbi\log\20200811140318.log
[2020-08-11 14:03:27.074]:     ... dialog closed

Does anyone have an idea how to fix this error or uninstall NetBeans 12.0 using another method?


Solution

  • After some trial and error, the following method worked for me:

    After that, the uninstall wizard couldn't find the registry keys for NetBeans 12.0 and stopped the uninstalling process. To fix this, I did the following:

    Finally, I was able to uninstall NetBeans 12.0 with no Nullpointer Exception.