Exception in thread "AWT-EventQueue-0" java.lang.InternalError

Hello all,

It has been a while since I have started arduino IDE and now when I upload code to the arduino mega 2560, I get this strange error that never happened before:

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:1928)
	at processing.app.Editor.handleSave(Editor.java:1903)
	at processing.app.Editor.handleRun(Editor.java:1612)
	at processing.app.Editor.handleRun(Editor.java:1607)
	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)

This happens everytime.

I reinstalled arduino IDE 1.8.1 and installed the latest java software.

Any guidance would be much appreciated

Are you really using Arduino IDE 1.8.1, or did you mean to write 1.8.10? If you're using 1.8.1, try updating to 1.8.10. If you're using 1.8.10, try 1.8.9. You can download Arduino IDE 1.8.9 here:
https://www.arduino.cc/en/Main/OldSoftwareReleases

There have been some significant changes to the IDE in the 1.8.10 release as Arduino transitions to using arduino-cli and this has resulted in some serious bugs that affect small number of users. I'm not sure that you are experiencing one of those bugs, since I haven't seen this specific error before, and didn't find it mentioned in any of the relevant bug trackers.

Hi pert,

Yes I am using 1.8.10 (didn't know the 0 at the end would make a difference )

It is very strange since it is the first time I have experienced such problem.

Have you got any recommendations as too what to do?

mateuszriou123:
didn't know the 0 at the end would make a difference

Yes, there is a big difference between Arduino IDE 1.8.1 and 1.8.10. 1.8.1 was released 2017-01-09, 1.8.10 was released 2019-09-13. A lot of development happened in the 20 months between the two.

mateuszriou123:
Have you got any recommendations as too what to do?

Try using Arduino IDE 1.8.9. You can download Arduino IDE 1.8.9 here:
https://www.arduino.cc/en/Main/OldSoftwareReleases

There have been some significant changes to the IDE in the 1.8.10 release as Arduino transitions to using arduino-cli and this has resulted in some serious bugs that affect small number of users. I'm not sure that you are experiencing one of those bugs, since I haven't seen this specific error before, and didn't find it mentioned in any of the relevant bug trackers.

Hi pert,

I will give it a go and get back to you.

Thank you

It works very nicely now.

Thank you again for you help as I just wasn’t sure what was going on.

You're welcome. I'm glad to hear it's working now. Hopefully the problem will be fixed in the Arduino IDE 1.8.11 release, which is planned to come out Monday.

Enjoy!
Per