Getting started with Java on the Raspberry Pi - UPDATE 2025
A lot of small and bigger examples to introduce you to Java, JavaFX, Pi4J, Spring, Queues... with hardware projects on the Raspberry Pi.
Get started with the latest versions of Java, JavaFX, Pi4J, Spring and so much more. Learn the power (and fun!) of experimenting with electronics. All explained in many small and easy to understand examples.
Minimum price
$9.99
$19.99
You pay
$19.99Author earns
$15.99About
About the Book
When I first managed to blink an LED connected to a Raspberry Pi with Java, I was super excited! Controlling physical things with some lines of code is magic! This book includes a lot of info and history about Java itself and how to install it on the Raspberry Pi. Also, there are a lot of tips and tricks to become or be a better developer. But, above all, there are many simple examples of these and even more other topics:
- The magic of Bits and Bytes and solving the confusion of Java signed values with the help of an LED number display.
- Beautiful user interfaces made with JavaFX so you can interact with the hardware.
- Pi4J applications to be able to control different types of hardware like LEDs, buttons, displays, LED strips, relais boards, and more. This chapter was further extended in 2023 to illustrate how easy it is to control electronics with Pi4J in combination with single-file applications with JBang.
- Spring applications so you can interact with your Pi via web interfaces.
- How to set up a queue to send and receive messages to and from Arduino boards or other Pi's.
- Interviews with some of my heroes: Karen Mouws (STEM and diversity), Alexander Belokrylov (BellSoft Liberica JDK), Trisha Gee (IntelliJ IDEA), Xiaokai He (Visual Studio Code), Jakob Jenkov (tutorials.jenkov.com), Johan Vos (OpenJFX, JavaFX, and GluonHQ), Robert Savage (Pi4J), Gerrit Grunwald (JavaFX, TilesFX), Mark Heckler (Spring), Vlad Mihalcea (JPA, Hibernate), Simon Ritter (Azul), Geertjan Wielenga (Azul and Foojay), Max Rydahl Andersen (JBang), Almas Baim (FXGL).
- And a lot of other inspirational ideas and getting-started examples to be able to build your dream do-it-yourself project.
My goal was to collect all the information that would have been bundled when I started my experiments with Java on the Raspberry Pi. If you are new to Java, you will learn the language bit by bit by following the examples. As an experienced Java programmer, you will learn how to extend your knowledge and control the world with simple and inexpensive components.
Categories
Feedback
Author
About the Author
Software developer and Java Champion with over 30 years of experience in video, multimedia, technical project management, digital signage, and (web) programming.
At work focusing on Java, but also used or using ASP.NET, C#, JavaScript, SQL Server, Flex, CSS, HTML5, Java, Eclipse, Qt...
I love to KISS (Keep It Simple, Stupid) and try to do this in everything I do.
Once a month lead coach of the CoderDojo Belgium club in Ieper, where we teach children (7-18) the fun of programming with Scratch, Arduino, Lego Mindstorms, and Minecraft...

Episode 234
An Interview with Frank Delporte
Contents
Table of Contents
- Introduction
- Tools and Hardware Used in this Book
- Choosing an IDE
- About Java
- The Raspberry Pi
- What is Maven?
-
About JavaFX
- History
- Interview with Johan Vos
- Sample Libraries to Extend JavaFX
- Interview with Gerrit Grunwald
- Minimal JavaFX 11 Sample Application
- Example 1: TilesFX Dashboard
- Start a Java Application when the Raspberry Pi Starts
- Disable Screensaver
- Example 2: Interact with an I²C Relay Board
- Example 3: Build a UI with FXML
- Bits and Bytes
- Pi4J
-
Spring Boot
- What is Spring Boot?
- What is Spring Initializr?
- Interview with Mark Heckler
- Example 1: Minimal Web Server on the Raspberry Pi
- Example 2: Database REST-service for IoT Data on Raspberry Pi
- Interview with Vlad Mihalcea
- Example 3: REST-service on the Raspberry Pi to Toggle an LED
- Example 4: Reactive Data
- Message Queues
- Conclusion
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Write and Publish on Leanpub
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.