Replies: 9 comments 13 replies
-
|
Is following the Tip & Tail approach (https://openjdk.org/jeps/14) an option here? You can branch out 11 here, and only add things to it when there are critical (security) issues, while using a later JDK version (21/23) on the tip? |
Beta Was this translation helpful? Give feedback.
-
|
I selected the LTS. As the code base is used in various projects/products i think we owe the community the level with the most stable support |
Beta Was this translation helpful? Give feedback.
-
|
Last weeks I have been experimenting a bit with Java on 32-bit Raspberry Pi (for older boards). As far as I know, only Java 8 and 11 are available. So if we bump to a higher version, we will exclude these boards from newer Pi4J features later. This is not a deal-breaker as we still will have the latest stable 2.X.Y release for those use-cases. But in that case, we will need to clearly document this. |
Beta Was this translation helpful? Give feedback.
-
|
I saw u made v3.0 for the java 21. That works well for the users. We need to also add some doc detail on how we implement fixes needed in both versions. |
Beta Was this translation helpful? Give feedback.
-
|
Closing this discussion. As of version 3.0.0 Pi4J will be based on Java 21. |
Beta Was this translation helpful? Give feedback.
-
|
Keep java 11. ARMv6 devices has no java version higher than 11. This will abandon older pi's. |
Beta Was this translation helpful? Give feedback.
-
|
Java 21 branch is merged! See https://www.pi4j.com/blog/2025/20250211-welcome-java-21/ |
Beta Was this translation helpful? Give feedback.
-
|
I've been following this for some time now. I agree with the idea of keep 2.8.0 on Java 11 and stable, with only bug (including security) fixes being applied (and maybe new boards. This also means that the v6 Pi boards out there (Pi 1s (there are many legacy), and Pi Zeros (important because they are still available and cheap)) can continue to work. There is however an issue. The docker-based (not podman?) build of the libgpiod because although it's compiled for the right architecture, it's linked against debian's v7 libraries and throws an illegal instruction error on Pi Zeros and 1s. I think the best solution is to build that library on a 32-bit version of Raspberry Pi OS. That's solve the problem. I even has a spare Pi 4 I can use to do this. Does anyone have any thoughts on the subject? Perhaps an alternative is to not use libgpiod on a Pi 1… |
Beta Was this translation helpful? Give feedback.
-
|
OK, this took a long time coming and it's an early draft, but comments please! This only covered creating the .so files. Building Pi4J 2.8.0 for a 32-bit Pi with ARM v6The problemThe current build system uses a 32-bit Debian cross-compile. This almost works fine. The compile phase correctly builds for the v6 architecture; however, the link phase to build the .so files uses Debian libraries which are compiled for the v7 architecture. The end result is that running pi4j on a v6 Pi results in an illegal instruction and the program aborting. This matters because of the legacy Pi 1s out there and also because some cheap and/or small systems will want to use Pi Zeros. It seems unfair to leave them out. Fixing it:For this you will need a reasonably powerful 32-bit Pi. I use an 8GB Pi 4 running the 32-bit version of Raspberry Pi OS. This is more than adequate for the task. Step 1: Build Pi4J. For this I downloaded the .tar.gz of 2.8.0, went into the top directory and ran mvn package. Happy days, it builds. Now we need to rebuild the .so files. Let's start with libpi4j-linuxfs.so I started with: Here we've built libpi4j-linuxfs.so. Now copy it somewhere safe as we'll be needing it later: Next up is libpi4j-pigpio.so, it's practically identical: Now we come to the slightly harder . The first part is the same as the above: The hard part is building the gpiod code itself. This will attempt to build libgpiod. It will fail! There may also be a lot of dependencies you need to install here, but I didn't log them. Sorry! Basically for every command that's missing you need to install it. This will depend a lot on what is on your machine already. What it does create is enough to try the build. Let's configure it: This produces lots of output. More importantly, it write a Makefile! Now run make. This leaves us lib/.libs/libgpiod.so.2.2.3, copy that to your patches area as libgpiod.so. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
At this moment, Pi4J V2 is built with Java 11 as the target, see https://github.com/Pi4J/pi4j-v2/blob/develop/pom.xml#L252
This means we miss out on many newer Java language and runtime improvements. Future versions will also make it easier to call C code to interact with the GPIOs, like JEP 454: Foreign Function & Memory API.
Do you agree we should move forward and bump Pi4J to a higher Java version? If so, which one?
12 votes ·
Beta Was this translation helpful? Give feedback.
All reactions