NeuronRobotics / nrjavaserial

A Java Serial Port system. This is a fork of the RXTX project that uses in jar loading of the native code.
Other
344 stars 143 forks source link

Q: How to get OpenJDK ARM64 running #186

Closed Gerry33 closed 4 years ago

Gerry33 commented 4 years ago

Hi all, and thanks for this work. I'm using a ARM64 system with

openjdk version "11.0.7" 2020-04-14 LTS OpenJDK Runtime Environment Zulu11.39+61-CA (build 11.0.7+10-LTS) OpenJDK 64-Bit Server VM Zulu11.39+61-CA (build 11.0.7+10-LTS, mixed mode)

My usage of nrjavaserial crashes at startup with Exception in thread "main" java.lang.NoClassDefFoundError: gnu/io/SerialPortEventListener at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:398)

I read somewhere in the bugs that there is option for OpenJDK to run, but I cannot find any hint about how and where. I would be very thanksfull for a hint. Regards Gery

MrDOS commented 4 years ago

The library should work on OpenJDK 11 and ARM64 without any particular intervention on your part.

Gerry33 commented 4 years ago

Hi and thanks for taking care.

What version of the library are you using? Can you share how you're including it in your project – Maven, Gradle, etc.? MAVEN:


<dependency>
<groupId>com.neuronrobotics</groupId>
<artifactId>nrjavaserial</artifactId>
**<version>5.1.1</version>**
</dependency>

> When do you get this error: right at application start, ...
Right at application start. I have a sysout as the very first statement after main() which does not appear.

I start using a runnable jar. 
'nrjavaserial-5.1.1.jar' is contained in that jar at root level.

"Hello World" and DACAPO benchmarks are running, so likely no issue with JAVA at all. 
Anyway, I'll inspect my JAVA Installation again. 

-- Update: The OpenJDK I'm using, has a classloader issue. Another jar built by me,  has similar issues.
Anyway, any help is appreciated. 

Gerry