2

Whenever I try to format a sketch in the IDE (1.8.19) I get this output in the terminal:

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: 'java.lang.String cc.arduino.packages.formatter.AStyleInterface.AStyleMain(java.lang.String, java.lang.String)'
          at cc.arduino.packages.formatter.AStyleInterface.AStyleMain(Native Method)
          at cc.arduino.packages.formatter.AStyle.run(AStyle.java:80)
          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$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:85)
          at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
          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)

...And formatting fails.

I can use astyle from the command line (linux mint) and it works well.

Guessing that some basic package was missing, or corrupted, I reinstalled Arduino, but the issue remained.

I don't precisely recall any specific changes made to my system prior to encountering this behavior, as it's been like this for at least 8 or 9 months now. I hadn't used Arduino for some time up until that point and it may have been a fresh instal.

Since I just started a new project for a buddy of mine and encountered the bug again I decided maybe it was time to see about a better solution.

Any help troubleshooting this would be greatly appreciated.

2

1 Answer 1

2

I googled the first line of stack trace and found similar issue on github (but for SUSE linux). In this issue the Arduino IDE was installed by system package manager and after downloading latest package from arduino.cc/en/software it started working.

In general Arduino IDE linux packages are somehow problematic (as far as I know Ubuntu has still version around 1.0.6) and it's better to use latest version directly from arduino.cc

1
  • I'm not sure that it's a version issue, maybe something in the dependencies... I installed from the Ubuntu Jammy package, and got Arduino 1.8.19, which yielded the error in the original post, on multiple installations. Then I installed that same version from the Arduino site and it worked fine.
    – InkyDigits
    Commented May 4, 2023 at 1:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.