title |
---|
Welcome to Pi4J |
Latest release: V3.0.1 (2025-03-24, see Release Notes).
This project is intended to provide a friendly object-oriented I/O API and implementation libraries for Java Programmers to access the full I/O capabilities of the Raspberry Pi platform. This project abstracts the low-level native integration and interrupt monitoring to enable Java programmers to focus on implementing their application business logic.
If you immediately want to "dive" into Pi4J development, check these resources:
- Prepare a Raspberry Pi for Java development.
- Starter examples: Creating a single file application with JBang.
- For experienced Java developers: Creating an application with Maven or Gradle.
The Pi4J Project was started in 2012, the same year the Raspberry Pi was introduced as a tool to provide Java developers a simple and familiar object-oriented interface library to access the low-level I/O capabilities of the Raspberry Pi including GPIO, I2C, SPI, PWM and Serial communications.
The Pi4j project has evolved in all these years as the whole Java eco-system and Raspberry Pi systems have been evolving. This resulted in the following main versions:
- V1.X: Deprecated, based on Java 8, later Java 11.
- V2.X.X: Completely reworked code base, based on Java 11.
- In 2.5.0, support for the Raspberry Pi 5 was added. Because of the new GPIO chip RP1, a new GPIO Provider was needed. See the this interview.
- V3.X.X: Based on Pi4J 2.8.0 and Java 21.
The Pi4J Project's mission is to provide a rich and powerful, yet simple to use, Java-friendly API library enabling programmatic access to the low-level hardware I/O capabilities of embedded platforms such as the Raspberry Pi.