xiaotudou@xiaotudou:~/data/test$ java -classpath .:classes:/opt/pi4j/lib/'*' LEDBreathingLight Let's gogogogogoogo...Breathing~ Sep 05, 2020 2:21:15 PM com.pi4j.util.NativeLibraryLoader load SEVERE: Unable to load [libpi4j.so] using path: [/lib/raspberrypi/dynamic/libpi4j.so] java.lang.UnsatisfiedLinkError: /tmp/libpi4j1709006903530610670.so: /tmp/libpi4j1709006903530610670.so: wrong ELF class: ELFCLASS32 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824) at java.lang.Runtime.load0(Runtime.java:809) at java.lang.System.load(System.java:1086) at com.pi4j.util.NativeLibraryLoader.loadLibraryFromClasspath(NativeLibraryLoader.java:159) at com.pi4j.util.NativeLibraryLoader.load(NativeLibraryLoader.java:105) at com.pi4j.wiringpi.Gpio.<clinit>(Gpio.java:189) at com.pi4j.io.gpio.RaspiGpioProvider.<init>(RaspiGpioProvider.java:69) at com.pi4j.io.gpio.RaspiGpioProvider.<init>(RaspiGpioProvider.java:51) at com.pi4j.platform.Platform.getGpioProvider(Platform.java:125) at com.pi4j.platform.Platform.getGpioProvider(Platform.java:118) at com.pi4j.io.gpio.GpioFactory.getDefaultProvider(GpioFactory.java:109) at com.pi4j.io.gpio.impl.GpioControllerImpl.<init>(GpioControllerImpl.java:53) at com.pi4j.io.gpio.GpioFactory.getInstance(GpioFactory.java:91) at LEDBreathingLight.main(LEDBreathingLight.java:29)
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.pi4j.wiringpi.Gpio.wiringPiSetup()I at com.pi4j.wiringpi.Gpio.wiringPiSetup(Native Method) at com.pi4j.io.gpio.RaspiGpioProvider.<init>(RaspiGpioProvider.java:69) at com.pi4j.io.gpio.RaspiGpioProvider.<init>(RaspiGpioProvider.java:51) at com.pi4j.platform.Platform.getGpioProvider(Platform.java:125) at com.pi4j.platform.Platform.getGpioProvider(Platform.java:118) at com.pi4j.io.gpio.GpioFactory.getDefaultProvider(GpioFactory.java:109) at com.pi4j.io.gpio.impl.GpioControllerImpl.<init>(GpioControllerImpl.java:53) at com.pi4j.io.gpio.GpioFactory.getInstance(GpioFactory.java:91) at LEDBreathingLight.main(LEDBreathingLight.java:29)
以下是正常的类库什么的 xiaotudou@xiaotudou:/opt/pi4j/lib$ gpio -v gpio version: 2.60 Copyright (c) 2012-2018 Gordon Henderson This is free software with ABSOLUTELY NO WARRANTY. For details type: gpio -warranty
Raspberry Pi Details: Type: Pi 4B, Revision: 04, Memory: 0MB, Maker: Sony * Device tree is enabled. *--> Raspberry Pi 4 Model B Rev 1.4 * This Raspberry Pi supports user-level GPIO access.