-
Notifications
You must be signed in to change notification settings - Fork 65
Native code and java 25 on Raspberrypi 5 #9
Description
I have a jdk 25.0.2 app running on a raspberry pi 5 with jdk 25.0.2.. I’ve run my command line many times on a raspberrypi 4 under java 11 with no problems. Now on a pi 5 under jdk 25 it can't find libpi4j-pigpio.so. I’ve asked chatGPT and github's AI and and am told to use a java command line option. one is --enable-native-library-loading and the other --enable-native-access=ALL-UNNAMED. The former is unrecognized but the latter is but doesn’t fix:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Pi4J was unable to extract and load the native library [/home/pi/NetBeansProjects/JLogger/dist/lib/libpi4j-pigpio.so] from the embedded resources inside this JAR [/home/pi/NetBeansProjects/JLogger/dist/lib/pi4j-library-pigpio.jar]. to a temporary location on this system. You can alternatively define the 'pi4j.library.path' system property to override this behavior and specify the library path. UNDERLYING EXCEPTION: [java.lang.UnsatisfiedLinkError]=/home/pi/NetBeansProjects/JLogger/dist/lib/libpi4j-pigpio.so: libpigpio.so.1: cannot open shared object file: No such file or directory at com.pi4j.library.pigpio.util.NativeLibraryLoader.load(NativeLibraryLoader.java:145) at com.pi4j.library.pigpio.internal.PIGPIO.<clinit>(PIGPIO.java:74) at com.pi4j.library.pigpio.impl.PiGpioNativeImpl.gpioInitialise(PiGpioNativeImpl.java:105) at com.pi4j.library.pigpio.PiGpio.initialize(PiGpio.java:159) at com.pi4j.plugin.pigpio.provider.gpio.digital.PiGpioDigitalOutputProviderImpl.create(PiGpioDigitalOutputProviderImpl.java:72) at com.pi4j.plugin.pigpio.provider.gpio.digital.PiGpioDigitalOutputProvid
What changed and how do I fix it. Cab I do anything in the java app to help?