I have instructed you guys on how to install the Spring Boot Command Line Interface on Windows and Linux. In this tutorial, I will guide you to install it on the macOS environment.
First, you also need to visit http://repo.spring.io/release/org/springframework/boot/spring-boot-cli/ to download the latest version of Spring Boot CLI. Currently, the latest version is 3.0.1 so the file you need to download is spring-boot-cli-3.0.1-bin.tar.gz. If you have a newer version then you do the same.
After downloading, please use the macOS tar command to unzip the downloaded file. If someone does not how to use the tar command, can reference here.
Result:
In order to be able to call Spring Boot CLI anywhere on your machine, you need to set the environment variable pointing to the bin directory of the Spring Boot CLI.
To do this, open the .bash_profile file in the user directory, and then add the following line to the end of the file:
1 |
export PATH=/Users/Khanh/Downloads/spring-3.0.1/bin:$PATH |
With /Users/Khanh/Downloads/spring-3.0.1/bin is the path that points to the bin directory of the Spring Boot CLI on my machine. Please replace the path to your Spring Boot CLI directory.
For this configuration to take effect immediately, you can run the following command:
1 |
. .bash_profile |
in the user directory.
Result: