Getting started with Spring Boot

Before writing any codes, you have to prepare the development environment in your local system. The backend APIs is built with Spring Boot, so you should prepare a Java development environment.

Prerequisites

Firstly you should get a OpenJDK redistribution installed in your system.

Java 11

According to the latest Java trends reportarrow-up-right from Jetbrains, currently the most widely-used Java version is Java 8, next is Java 11.

Oracle had ended security updates of Java 8 in the early 2019. For those want to use Java 8 in production, you have to subscribe Oracle commercial support, or switch to other redistributions.

Oracle changed Java release progress and tried to accelerate the Java release cycles to very six months. And the next long term support version is Java 11, which is recommended to use in commercial products.

In this book, we will use Java 11 as Java development environment. Aligned with Spring Boot 2.2, we will try to use the latest Java language feature from Java 8 to Java 11.

You can download one of the following JDK 11 redistribution, and get it installed into your system.

Additionally, Azularrow-up-right, Amazonarrow-up-right, Alibabaarrow-up-right, and Microsoftarrow-up-right have maintained their own OpenJDK redistribution for their products.

I prefer AdoptOpenJDK, because AdoptOpenJDK is maintained by Java communities.

Optionally, you can set JAVA_HOME environment variable and add <JDK installation dir>/bin in your PATH environment variable.

Open your terminal, execute the following command to verify your Java environment installed successfully.

Apache Maven

Apache Maven and Gradle are the most popular build tools in the Java communities.

Personally, I prefer Apache Maven.

Download the latest Apache Maven from http://maven.apache.orgarrow-up-right, and extract the files into your local system.

Optionally, you can set M2_HOME environment variable, and also do not forget to append <Maven Installation dir>/bin your PATH environment variable.

Type the following command to verify Apache Maven is working.

Gradle (Optional)

If you are a Gradle fan, get it from Gradle websitearrow-up-right, and installarrow-up-right it into your system.

Java IDE

The most popular integration development environment in Java communities includes:

You can choose your favorite one to write Java codes.

Last updated