Fix for: Arduino IDE won't start (java.lang.NullPointerException)

There was a problem with Arduino's package_index.json file used for Boards Manager that caused the Arduino IDE to no longer start for anyone who opened Boards Manager during a ~12 hour period on Jun 9th.

The package_index.json file has now been fixed. The recommended solution for anyone still affected is to update to Arduino IDE 1.8.13.


If you were affected by this bug, and for some reason you wish to continue using an older version of the Arduino IDE, you must delete the bad package_index.json from your computer as well as the cache folder, then restart the Arduino IDE as usual.

Windows (regular IDE):

remove file C:\Users\YourUsername\AppData\Local\Arduino15\package_index.json
remove folder C:\Users\YourUsername\AppData\Local\Arduino15\cache

Windows (Microsoft Store app):

remove file C:\Users\YourUsername\Documents\ArduinoData\package_index.json
remove folder C:\Users\YourUsername\Documents\ArduinoData\cache

Mac:

remove file /Users/YourUsername/Library/Arduino15/package_index.json
remove folder /Users/YourUsername/Library/Arduino15/cache

Linux:

remove file /home/YourUsername/.arduino15/package_index.json
remove folder /home/YourUsername/.arduino15/cache

Arduino IDE in portable mode:

remove file {Arduino IDE installation folder}/portable/package_index.json
remove folder {Arduino IDE installation folder}/portable/cache

NOTE: These are in hidden folders. You will need to configure your file browser software to show hidden folders in order to see them.


The problem that caused the Arduino IDE to break from the bad package index file this fix is in the Arduino IDE 1.8.13 release. That's the reason why the Nightly/Beta Builds were not affected, and also the reason why we did not detect this problem earlier.

Sorry for any inconvenience this has caused!

1 Like

I really don't know to thank u
Am really grateful it working back

You're welcome. I'm glad to hear it's working now. Enjoy!
Per

hello, that solved the problem of opening the IDE, however now it won't let me compile new programs or modifications of previous programs.
the errors returned to me by the IDE are:
If anyone can help me, Ill be grateful

Exception in thread "AWT-EventQueue-0" java.lang.InternalError: Should not get here
at sun.nio.fs.WindowsNativeDispatcher.GetFinalPathNameByHandle(Native Method)
at sun.nio.fs.WindowsLinkSupport.getFinalPath(WindowsLinkSupport.java:77)
at sun.nio.fs.WindowsLinkSupport.getRealPath(WindowsLinkSupport.java:242)
at sun.nio.fs.WindowsPath.toRealPath(WindowsPath.java:836)
at sun.nio.fs.WindowsPath.toRealPath(WindowsPath.java:44)
at processing.app.BaseNoGui.saveFile(BaseNoGui.java:897)
at processing.app.SketchFile.save(SketchFile.java:287)
at processing.app.Sketch.save(Sketch.java:138)
at processing.app.SketchController.save(SketchController.java:352)
at processing.app.Editor.handleSave2(Editor.java:1900)
at processing.app.Editor.handleSave(Editor.java:1875)
at processing.app.Editor.handleRun(Editor.java:1584)
at processing.app.Editor.handleRun(Editor.java:1579)
at processing.app.EditorToolbar.handleSelectionPressed(EditorToolbar.java:465)
at processing.app.EditorToolbar.mousePressed(EditorToolbar.java:448)
at java.awt.Component.processMouseEvent(Component.java:6536)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6304)
at java.awt.Container.processEvent(Container.java:2239)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2297)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4532)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
at java.awt.Container.dispatchEventImpl(Container.java:2283)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
at java.awt.EventQueue$4.run(EventQueue.java:733)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Pert, now it's working for me too. Thank you!

(How on earth do you find out about these things???)

:smiley:

lilabner045:
Pert, now it's working for me too. Thank you!

You're welcome. I'm glad to hear it's working now!

lilabner045:
(How on earth do you find out about these things???)

I do have a bit of an inside track due to working for Arduino. However, that insider knowledge isn't actually very useful for providing support because it's all under an NDA. In some ways it makes my job more difficult because I have to try to keep straight which parts of my knowledge are "top secret" (usually without any actual reason for being a secret other than that it happened to be discussed via a private communication channel), and which are public.

A source of information much more useful to me is following the happenings in Arduino's various public GitHub repositories (most especially this one). The Arduino developers posted this information there and I essentially just did a copy/paste, with some minor modifications I thought would make them more useful to the average Arduino user.

eduar85:

Exception in thread "AWT-EventQueue-0" java.lang.InternalError: Should not get here
at sun.nio.fs.WindowsNativeDispatcher.GetFinalPathNameByHandle(Native Method)

My research indicates this is related to a problem Java has with Windows file junctions. I don't know how the fix for this bug would trigger this.

Did you follow the exact instructions I posted above, or did you do any additional steps, such as deleting other files/folders or uninstalling the Arduino IDE while you were trying to fix the bug? If you did other things, please describe them.

Try this:

  • File > Preferences
  • Uncheck the box next to "Save when verifying or uploading".
  • Click the "OK" button.

Now try compiling again. Does the error still occur? This test is intended to determine whether this issue is isolated to the save sketch process.

Thank you very much for the reply!
I initially found the solution in another forum in which it proposes to delete the entire 'arduino15' folder. I did and the initialization of the program was fixed but I started with the decrypt problem.
Update Java (it was already updated). delete and reinstall the latest version of Arduino. Everything was the same.
When I compile a program that was previously saved, it compiles seamlessly. The error occurs when I want to compile a new / modified sketch.

pert:
Try this:

  • File > Preferences
  • Uncheck the box next to "Save when verifying or uploading".
  • Click the "OK" button.

Now try compiling again. Does the error still occur? This test is intended to determine whether this issue is isolated to the save sketch process.

I did what you suggested and now compile in new sketch with no problems.
Then I save it as a new sketch ('save as') and it is saved. But when I want to save it as a modification (just 'save' - down arrow) the problem reappears.
In other words, now I can continue working on my sketches, but each modification must be saved as a different file.
When the error occurs, a file like the following is generated in the folder where the sketch would be saved:
sketch1.ino7203836517220358640.tmp

Thanks again