Pi4J / pi4j-v1

DEPRECATED Java I/O library for Raspberry Pi (GPIO, I2C, SPI, UART)
http://www.pi4j.com
Apache License 2.0
1.31k stars 448 forks source link

dependency on javax.xml.bind makes it impossible to jlink on JDK 11 #546

Open Sciss opened 2 years ago

Sciss commented 2 years ago

For example, using pi4j 1.4 in my project, I get

[error] Exception in thread "main" java.lang.module.FindException: Module java.activation not found, required by java.xml.bind
[error]     at java.base/java.lang.module.Resolver.findFail(Resolver.java:877)
[error]     at java.base/java.lang.module.Resolver.resolve(Resolver.java:191)
[error]     at java.base/java.lang.module.Resolver.resolve(Resolver.java:140)
...

This origin of this problem is module-info bug in javax.activation, this issue: https://github.com/fvarrui/JavaPackager/issues/55

FDelporte commented 2 years ago

See SO comment: Did you consider moving to Pi4J V2? That one is fully modularized and has only slf4j as dependency...

Sciss commented 2 years ago

The two reasons for staying on 1.x are compatibility with JDK 8, and complete API change. If I compile my project as such, I am getting >50 errors, as apparently not a single class is the same in 2.x than in 1.x...

FDelporte commented 2 years ago

Can you try version 1.3 regarding Java 8? 1.4 -> Java 11 https://pi4j.com/about/previous-version-v1/