0

Installation Steps

  1. Download and install JDK 10.0.2
  2. Download and unzip Netbeans 9 (Apache)
  3. Change netbeans.conf with correct JDK path ("C:\ProgramFiles\Java\jdk-10.0.2")
  4. Configure syestem variable and environment variable
  5. Start Netbeans 64x as administrator
  6. Getting java.lang.NullPointerException in Netbeans

I'm using Windows 10 as operating system and I followed these steps on my Windows 7 Desktop PC without any problems.

While using my Windows 10 notebook, I'm getting the same error every time I start netbeans.

Creating new projects works but only the default project templates (Java Modular Project and Java Free-Form Project). Opening existing projects works for default projects. Opening projects without default templates doesn't work.

This is the error I get after starting 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)

Log file in AppData:

Part 1: https://pastebin.com/m4Gv7S4Y Part 2: https://pastebin.com/rRt8vC76

cmonbruh
  • 21
  • 3
  • Please state your question. – natn2323 Oct 22 '18 at 13:36
  • For this kind of thing it is often best to make a post on the product's forum or do some ing. – SamTebbs33 Oct 22 '18 at 14:00
  • You may need to specify the path to your JDK 10 installation in file **netbeans.conf** (which resides in the **etc** directory under your NetBeans installation directory) and then restart NetBeans. See https://stackoverflow.com/a/52306515/2985643 – skomisa Oct 23 '18 at 06:11
  • @natn2323 My question is how I get netbeans to actually work and load all the project modules (JavaFX, Maven, NetBeans) – cmonbruh Oct 23 '18 at 22:25
  • @SamTebbs33 Search engines haven't helped so far. Still trying tho. – cmonbruh Oct 23 '18 at 22:27
  • @skomisa I've already done that and just edited it in my question. – cmonbruh Oct 23 '18 at 22:28
  • OK. [1] Why is it necessary for you to run NetBeans as an administrator? [2] Do you have the same problem if you don't run NetBeans as an administrator? [3] You have made it necessary to download your log file to view it, but that is not the way things are done here. Either paste the log within your question, or (if it is large) provide a link so it can be viewed online. – skomisa Oct 24 '18 at 04:10
  • [1] It get the problem with and without running as administrator. I wanted to make clear that I have administrator rights. [3]The problem was that it was too large for either pastebin or as code inside stackoverflow. I've just created two pastebin parts which represent the message.log file in "C:\Users\user1\AppData\Roaming\NetBeans\9.0\var\log" and putted in my question. – cmonbruh Oct 24 '18 at 07:20
  • [1] Start NetBeans > **Help > About** > Get the name of **User directory** [2] Close NetBeans and delete that user directory. [3] Start NetBeans. Any better? See [FaqWhatIsUserdir](http://wiki.netbeans.org/FaqWhatIsUserdir). You could also try deleting your **Cache directory**. That may not help, but it certainly won't do any harm. – skomisa Oct 24 '18 at 17:32
  • Can confirm that deleting User directory worked for me. I can see all the project modules now and I don't get any errors anymore. Thank you sir! – cmonbruh Oct 25 '18 at 14:55
  • In my case the 'netbeans' color scheme seems to be broken. After changing the color scheme the NPE disappears. – Maia Aug 05 '19 at 11:48

0 Answers0