0

安装步骤

  1. 下载并安装 JDK 10.0.2
  2. 下载并解压 Netbeans 9 (Apache)
  3. 使用正确的 JDK 路径(“C:\ProgramFiles\Java\jdk-10.0.2”)更改 netbeans.conf
  4. 配置系统变量和环境变量
  5. 以管理员身份启动 Netbeans 64x
  6. 在 Netbeans 中获取 java.lang.NullPointerException

我使用 Windows 10 作为操作系统,并且在我的 Windows 7 台式电脑上按照这些步骤操作,没有任何问题。

在使用我的 Windows 10 笔记本时,每次启动 netbeans 时都会遇到相同的错误。

创建新项目有效,但只能使用默认项目模板(Java Modular Project 和 Java Free-Form Project)。打开现有项目适用于默认项目。打开没有默认模板的项目不起作用。

这是我在启动 Netbeans 9 后得到的错误。

java.lang.NullPointerException
    at org.netbeans.modules.editor.fold.ui.CodeFoldingSideBar.resolveBackColor(CodeFoldingSideBar.java:350)
    at org.netbeans.modules.editor.fold.ui.CodeFoldingSideBar.updateColors(CodeFoldingSideBar.java:365)
    at org.netbeans.modules.editor.fold.ui.CodeFoldingSideBar.access$200(CodeFoldingSideBar.java:99)
    at org.netbeans.modules.editor.fold.ui.CodeFoldingSideBar$2.preferenceChange(CodeFoldingSideBar.java:228)
    at org.netbeans.modules.editor.fold.ui.CodeFoldingSideBar.addNotify(CodeFoldingSideBar.java:284)
    at java.desktop/java.awt.Container.addNotify(Container.java:2798)
    at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4783)
    at org.netbeans.modules.editor.impl.CustomizableSideBar$WestSidebarHolder.addNotify(CustomizableSideBar.java:286)
    at java.desktop/java.awt.Container.addNotify(Container.java:2798)
    at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4783)
    at java.desktop/java.awt.Container.addNotify(Container.java:2798)
    at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4783)
    at java.desktop/java.awt.Container.addNotify(Container.java:2798)
    at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4783)
    at java.desktop/java.awt.Container.addNotify(Container.java:2798)
    at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4783)
    at java.desktop/java.awt.Container.addNotify(Container.java:2798)
    at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4783)
    at java.desktop/java.awt.Container.addNotify(Container.java:2798)
    at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4783)
    at java.desktop/javax.swing.JRootPane.addNotify(JRootPane.java:733)
    at java.desktop/java.awt.Container.addNotify(Container.java:2798)
    at java.desktop/java.awt.Window.addNotify(Window.java:786)
    at java.desktop/java.awt.Frame.addNotify(Frame.java:490)
    at java.desktop/java.awt.Window.pack(Window.java:824)
    at org.netbeans.modules.java.editor.JavaEditorWarmUpTask.run(JavaEditorWarmUpTask.java:269)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
    at java.desktop/java.awt.EventQueue.access$600(EventQueue.java:97)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
    at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
[catch] at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

AppData 中的日志文件:

第 1部分: https ://pastebin.com/m4Gv7S4Y 第 2部分: https ://pastebin.com/rRt8vC76

4

0 回答 0