Visual Studio Code on the Raspberry Pi (with 32 and 64-bit OS)
In my book “Getting Started with Java on the Raspberry Pi”, I give more info about IDEs (= Integrated Development Environment) for Java development. My prefered ones are JetBrains IntelliJ IDEA and Microsoft Visual Studio Code (VSC).
IntelliJ IDEA is the most used IDE by Java developers and is available in a free edition with some limited features, or a full paid version.
Visual Studio Code is totally free but until recently was not available in an official version for the Raspberry Pi. You can find a version in the GitHub projects of Steve Desmond for version 1.28.2, but VSC is already on version 1.50.1 today.
Luckily Microsoft decided to release new versions again with installers for both 32-bit and 64-bit Raspberry Pis. Jieha! Let’s install and test them…
On your Raspberry Pi open a browser and go to the Visual Studio Code download page. We will be using the Linux .deb-files.
Raspberry Pi OS 32-bit
If you are using a “default” Raspberry Pi OS - which is 32-bit version - you need to download the “ARM” file. Once downloaded, start a terminal and run the installation with:
$ cd /home/pi/Downloads $ sudo apt install ./code_1.50.1-1602600660_armhf.deb
You can now start VSC from the start button and you will find it in the “Programming” list.
There it is, the latest version 1.50.1 on a Linux ARM processor!
Raspberry Pi OS 64-bit
If you are already using the newer work-in-progress 64-bit Raspberry Pi OS (see more info in my post “64-bit Raspbian OS on Raspberry Pi 4 with USB BOOT”, you will need another version.
Select the “ARM 64” version from the download page. The installation command is the same as before, but with a slightly different filename.
$ cd /home/pi/Downloads $ sudo apt install ./code_1.50.1-1602600638_arm64.deb
Also here you’ll now find Visual Studio Code in the Programming list in the start menu. Let’s add the “Java Extension Pack”, so we can test a Java application.
Maven and BellSoft JDK with JavaFX are already installed on my board:
$ mvn -version Apache Maven 3.6.0 Maven home: /usr/share/maven Java version: 11.0.8, vendor: BellSoft, runtime: /home/pi/.sdkman/candidates/java/11.0.8.fx-librca Default locale: en_GB, platform encoding: UTF-8 OS name: "linux", version: "5.4.51-v8+", arch: "aarch64", family: "unix" $ java -version openjdk version "11.0.8" 2020-07-14 LTS OpenJDK Runtime Environment (build 11.0.8+10-LTS) OpenJDK 64-Bit Server VM (build 11.0.8+10-LTS, mixed mode)
Without any further installation, we can now try out one of the examples of my book, the “JavaFX dashboard application”.
The Raspberry Pi was already a powerful PC at a lower price. Now with Visual Studio Code being released with versions for our beloved board, and all the extensions which are available for this IDE, we can use the Raspberry Pi as a real developer PC for Java and many other programming languages!