This article will show you how to install Spring Boot Command Line Interface on Linux system, which includes RHEL, CentOS, Fedora, Debian, Ubuntu, etc. There are 2 ways for us to do that. The first is to install manually and the second is to install with SDKMAN. We will cover both of 2 ways in this article.

Install Spring Boot Command Line Interface on Linux

Spring Boot CLI

1. Prerequisites

  • Spring Boot CLI requires Java 6 or above in order to run.
  • JAVA_HOME environment variable should be set to a JDK

2. Install Spring Boot Command Line Interface on Linux

2.1. Install Spring Boot CLI Manually

2.1.1. Download Spring Boot CLI

You can visit Spring Boot repository to download the Spring Boot CLI version that you desire by following the below link:

http://repo.spring.io/release/org/springframework/boot/spring-boot-cli

Currently, the latest version is: 1.4.0

So, we will try to download the Spring Boot CLI 1.4.0.

http://repo.spring.io/release/org/springframework/boot/spring-boot-cli/1.4.0.RELEASE/spring-boot-cli-1.4.0.RELEASE-bin.tar.gz

You can download it using web browser or using wget command.

2.1.2. Extract the compressed file

We will extract the file to /opt/spring-boot folder

2.1.3. Set SPRING_HOME environment variable

Edit the /etc/profile by any editor such as: vim, nano, and append following lines at the end of the file.

Then, issue below command make the environment variables effectively/

2.1.4. Verify

To verify whether the Spring Boot CLI was installed successfully or not, we can issue below command:

The output should be:

Well done! we have just finished to install Spring Boot Command Line Interface on Linux manually.

2.2. Install Spring Boot CLI with SDKMAN

SDKMAN is a tool for managing parallel versions of multiple Software Development Kits on most Unix based systems. We can leverage SDKMAN to install Spring Boot Command Line Interface on Linux.

2.2.1. Install SDKMAN

2.2.1.1. Open a terminal and enter:

Then follow the instructions on-screen to complete installation.

Note that, SDKMAN may ask you to install unzip package as the following:

In that case, you simply need to install unzip using your favourite package manager. For example, I’m using Ubuntu; therefore, I use apt-get to install unzip

So, if your OS is CentOS or RHEL, you can issue:

2.2.1.2. Enter the following code snippet

2.2.1.3. Lastly, verify that installation succeeded

You should see the output:

We have finished to install the SDKMAN, in the next section, we will install Spring Boot CLI.

2.2.2. Install the Spring Boot CLI

2.2.2.1. On the terminal, enter:

Confirm Y if the installation asks you to set Spring CLI v1.4.0.RELEASE as default.

2.2.2.2. Verify the installation.

We have finished to install Spring Boot Command Line Interface by using SDKMAN. Let’s verify whether the installation was successful or not.

On the terminal, enter:

3. Summary

We have finished to install Spring Boot Command Line Interface on Linux with manual way and SDKMAN. You can select any way you like. However, with SDKMAN, you will be easy to update and witch between different versions. In future posts, we’ll explore some popular commands of Spring Boot CLI. If you’re looking for install Spring Boot CLI on Windows, you can refer to the following post: Install Spring Boot Command Line Interface on Windows

Here is another post related to Spring Boot if you may be interested in:

How To Run A Spring Boot Application

How to Configure Logging in Spring Boot

Package a Spring Boot Application Into War File

JUnit 5 and Spring Boot Example

 

 

0 0 vote
Article Rating