Arduino on Linux with Java 9 internal bug - fix

Aus Markus' Wiki
Version vom 25. Dezember 2017, 18:04 Uhr von Markus (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „== Problem description == The Arduino GUI refuses to start. I have hit the following bug: Exception in thread "main" java.lang.ExceptionInInitializerError…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche

1 Problem description

The Arduino GUI refuses to start.

I have hit the following bug:

Exception in thread "main" java.lang.ExceptionInInitializerError
at processing.app.Preferences.save(Preferences.java:735)
at processing.app.Preferences.init(Preferences.java:249)
at processing.app.Base.main(Base.java:117)
Caused by: java.lang.NumberFormatException: For input string: "9-i"
at jdk.internal.math.FloatingDecimal.readJavaFormatString(java.base@9-internal/FloatingDecimal.java:2054)
at jdk.internal.math.FloatingDecimal.parseFloat(java.base@9-internal/FloatingDecimal.java:122)
at java.lang.Float.parseFloat(java.base@9-internal/Float.java:451)
at java.lang.Float.<init>(java.base@9-internal/Float.java:532)
at processing.core.PApplet.<clinit>(Unknown Source)

2 Solution

Here is a good description of the error:

https://askubuntu.com/questions/832486/errors-when-trying-to-run-arduino

Fix:

Downloading the Java 8u152 JDK from Oracle. Removal of OpenJDK Java 9 from my system and replacing it by Oracle's Java 8u152 version.

The bug is due to a parsing error of the version string. Replacing the "9-internal" version by a regularly numbered Java version will help. I chose to use the 8u152 version from Oracle.

In order to keep up Debian / Ubuntu package management, I decided to build a deb package, following the following solution proposal:

https://wiki.debian.org/JavaPackage