Javarevisited
Published in

Javarevisited

Building an Electronics Project with Java, Maven, and Pi4J on Raspberry Pi with Visual Studio Code

On Thursday 29th of May, Raspberry Pi announced a new $75 board with 8GB RAM, a very small but powerful computer. This new board comes next to the ones with 2GB (35$) and 4GB (55$) which have the same processor and ports.

4K display connected to Raspberry Pi 4

Some time ago I bought the 4GB version and combined it with a 4K display and was really amazed by the power of this board. On the screenshot, you can see it running with two Visual Studio Code windows, Arduino IDE and some others…

The MagPi Magazine

Based on my experience to get started with Java development on the Raspberry Pi, I wrote two articles for The MagPi Magazine which is published by the Raspberry Pi Foundation and can be freely downloaded or bought in paper version from their website:

These two articles describe every step required to start Java development on the Raspberry Pi with Maven in Visual Studio Code. The Pi4J framework is also used to control a LED and read the state of a button connected to the GPIO’s of the Raspberry Pi board.

To make everything more clear, this video shows every step described in the articles:

64-bit Raspbian OS

Raspbian OS is the default operating system for the Raspberry Pi, but is now only available in a 32-bit version which means “only” 3GB can be used per process. The same day as the 8GB board was announced, a post describing the beta test version of a 64-bit Raspbian OS was published on the forum. This will allow to install 64-bit software (e.g. the latest version of Visual Studio Code) which can use more memory.

Boot from USB storage

One of the weak points of the Raspberry Pi is the SD card with the OS. It can get corrupted, for instance, if you cut the power. But there is also a beta test solution that allows us to use a USB storage device.

Conclusion

When 8GB RAM + 64-bit OS + USB mass storage boot get past the beta stage, the Raspberry Pi will become an even stronger PC for everyday use at a very low price! I’m really looking forward to upgrade my home office… :-)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store