Open
Description
Using RF24 library for nRF24L01
upgraded arduino (1:1.8.9-1 -> 1:1.8.9-3)
OS: arch linux
Following error is thrown after upgrade
Exception in thread "EventThread /dev/ttyUSB1" java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;
at processing.app.Serial.serialEvent(Serial.java:185)
at jssc.SerialPort$LinuxEventThread.run(SerialPort.java:1299)
Relevant github issue?
apache/felix#114
Activity
DWShuo commentedon May 21, 2019
Just rolled back to package version 1:1.8.9-1, and everything works fine.
Seems like 1:1.8.9-3 is indeed the issue
facchinm commentedon May 21, 2019
@NicoHood maybe you lost this 😉
harkor commentedon May 29, 2019
Same issue here.
Rolling back to 1:1.8.9-1 working :)
NicoHood commentedon May 29, 2019
What should I do to fix this??
facchinm commentedon May 29, 2019
I think compiling with java8 should fix it
NicoHood commentedon May 30, 2019
But shouldn't Arduino support java 8 and all higher versions?
facchinm commentedon May 30, 2019
I think you need to compile the jars with java 8 exactly, so the dependency here should be
java-runtime=8
(I think)DWShuo commentedon May 30, 2019
Ok figure it out, for some reason arch defaults to jdk8, you have to manually set java to a higher version.
Do this to check which versions of java you have installed
archlinux-java status
if java-8-openjdk/jre is your only option then run this
pacman -Syu jdk-openjdk
run
archlinux-java status
again should have java11 now as an optionswitch to java11
sudo archlinux-java set java-11-openjdk
NicoHood commentedon May 31, 2019
I am not very familiar with java programming. Code compiled with java will only run with java8 interpreter? Or will it run with 8 and every version above? Is the problem that I've compiled the code with java 11, but with an old java8 interpreter it crashes? Changing the OS java version does not sound like a solution, more a workaround. Can somebody please explain me better how this works?
PaulStoffregen commentedon May 31, 2019
Kind of a moot point, since the Arduino IDE bundles the correct Java JRE which precisely matches the version of the Java SDK they used to build the code.
winksaville commentedon Jun 13, 2019
@NicoHood as @PaulStoffregen says, the Java SDK should probably be used. The reason is not all Java 8's are the same.
On my arch linux system, just updated:
I have java 8 installed as my default:
And the version reported by java is 1.8.0_212:
Which is slightly different from the version provided by arduino-1.8.9, 1.8.0_191:
And I don't get the "NoSuchMethodError" when I'm using arduino-1.8.9 directly but I do get this error when I install the Arch Linux arduino package. A workaround that is suggested in the Arch Linux bug report 62704 of changing to java 10 or 11 does resolve this bug but then I get some warnings:
So it seems it would be best to change Arch Linux arduino PKGBUILD to use the java provided by arduino and not the system installed version.
PaulStoffregen commentedon Jun 13, 2019
Seems to me this is a problem with Arch Linux. The software Arduino.cc distributes always has the correct JRE bundled, so I do not believe reporting the problem here is correct.
toketin commentedon Jul 11, 2019
Hi, i confirm with Java 12 i had issue with the menu theme of Arduino Ide. Reinstalling Java 8 and setting:
archlinux-java set java-8-openjdk/jre
i can get the correct theme again.This was the output running arduino ide with Java 12 as default:
fam4r commentedon Oct 9, 2019
I can not access Serial using Java 8 and Arduino
1.8.9-3
, but it works with Arduino1.8.9-1
.Java 12 is not affected by that problem, but shows warnings as reported from some of you.
24 remaining items