Pi4J implements a JNI wrapper of the WiringPi library (originally) developed by Gordon Henderson.
Pi4J dynamically compiles against the WiringPi library so you must have Wiring Pi installed on your target system. WiringPi is included by default in the latest Raspbian builds; however, it may not be the latest version.
More information on the WiringPi project can be found here:
http://wiringpi.com/
ATTENTION: The original WiringPi library has been **DEPRECATED** and is no longer maintained.
To support RaspberryPi 4B/400/CM4 and newer systems you must install the latest *unofficial* WiringPi version which is maintained here: https://github.com/WiringPi/WiringPi.
If you have Pi4J installed on your RaspberryPi, you can use the following script command to download, build and install the latest unofficial build of WiringPi.
sudo pi4j --wiringpi
Alternatively, you can use the following shell commands to download, build and install the latest unofficial build of WiringPi.
sudo apt-get remove wiringpi -y sudo apt-get --yes install git-core gcc make cd ~ git clone https://github.com/WiringPi/WiringPi --branch master --single-branch wiringpi cd ~/wiringpi sudo ./build
(click here for hi-resolution image)
Additional compile-time dependency information can be found here: Dependency Information Report