1

我正在尝试卸载 NetBeans 12.0,但向导在启动时抛出以下异常:

异常:java.lang.NullPointerException:空

日志这样说:

[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

有谁知道如何修复此错误或使用其他方法卸载 NetBeans 12.0?

4

1 回答 1

2

经过反复试验,以下方法对我有用:

  • 进入您的用户目录 (C:\Users\YourUsername\) 并在其中找到.nbi目录
  • 删除 .nbi 目录(或将其移动到其他位置)
  • 运行 NetBeans 12.0 卸载程序

之后,卸载向导找不到 NetBeans 12.0 的注册表项并停止卸载过程。为了解决这个问题,我做了以下事情:

  • 删除您的 Netbeans 12.0 目录 (C:\Programs\NetBeans 12.0\)
  • 使用安装向导再次安装 NetBeans 12.0
  • 通过 Windows 10 设置卸载 NetBeans 12.0

最后,我能够在没有 Nullpointer 异常的情况下卸载 NetBeans 12.0。

于 2020-08-12T17:42:41.453 回答