
Setting up your development environment for Spring Boot on Ubuntu 24.04 LTS is a straightforward process that lays the foundation for building robust Java applications. To get started, you primarily need the Java Development Kit (JDK), as Spring Boot requires it to run. While you can manage projects manually, using build tools like Maven or Gradle is highly recommended for dependency management and project structure. For quick scripting or testing, the Spring Boot CLI is also a valuable tool.
Here’s a breakdown of the essential steps to get you configured:
First, ensure your package lists are up-to-date by opening your terminal and running:
sudo apt update
The core requirement is the JDK. OpenJDK is a popular choice and readily available in Ubuntu’s repositories. To install a recent version, like OpenJDK 17 (a common choice for Spring Boot), execute:
sudo apt install openjdk-17-jdk
You can replace openjdk-17-jdk
with another version if needed, such as openjdk-21-jdk
for OpenJDK 21.
Verify the installation by checking the Java version:
java -version
Next, installing a build tool simplifies project management significantly.
For Maven, use the command:
sudo apt install maven
Check its version to confirm installation:
mvn -v
For Gradle, install it with:
sudo apt install gradle
Verify with:
gradle -v
You only need one of these, typically based on your project or team preference.
If you plan on using the Spring Boot CLI for quick application prototyping or running simple Groovy scripts with Spring Boot, you’ll need to download it. While not strictly necessary for all Spring Boot development, it’s a handy utility. The recommended way is often via a package manager like SDKMAN!, or you can download the distribution archive from the official Spring releases and manually add its bin
directory to your system’s PATH environment variable.
After installing the JDK and optionally a build tool and the CLI, your Ubuntu 24.04 system is ready for Spring Boot development. You can now use your chosen IDE or build tool to create a new Spring Boot project and start building your applications. Ensuring these foundational components are correctly installed is the crucial first step to successful Spring Boot development on Linux.
Source: https://www.fosstechnix.com/install-spring-boot-application-on-ubuntu-24/