Spring boot CLI is a spring command-line tool that can help you develop spring applications quickly and easily. It utilizes spring’s start dependence and automation configuration features, then developers can focus on the business logic code, does not need to care about the project jars dependency and configuration. This article will tell you how to install spring boot CLI on macOS, Linux, and Windows.
1. Install Spring Boot CLI Manually.
- This method is useful for both macOS, Linux, and Windows.
- Go to the spring boot getting started and installation page and download spring-boot-cli-2.1.0.BUILD-SNAPSHOT-bin.zip.
- Unzip the downloaded file to a local folder. You can find there is a bin folder under it. There are two executable files, one is spring( for Mac or Linux ) the other is spring.bat( for Windows ).
- Open a terminal and execute the below command to add the above bin folder to the current system environment variable PATH‘s value.
# Go to user home directory. $ cd ~ $ ls -l .bash_profile # Edit .bash_profile file. $ vim .bash_profile # Add spring boot CLI bin folder to system environment variable PATH value and save .bash_profile file. $ export PATH="/Users/zhaosong/Downloads/spring-2.1.0.BUILD-SNAPSHOT/bin:$PATH" # Make above change effective. $ source .bash_profile
- To verify spring boot CLI installation correctly, run
spring --versionin terminal.
localhost:~ $ spring --version Spring CLI v2.0.2.RELEASE
- Run spring boot CLI shell. You can run commands in the spring boot CLI shell, you can execute a lot of CLI commands in the shell, and press the TAB key to auto-complete CLI shell commands.
2. Install Spring Boot CLI On MacOS Use HomeBrew.
- Ensure HomeBrew is installed in your macOS.
localhost:~ $ brew -v Homebrew 1.7.4 Homebrew/homebrew-core (git revision cc23; last commit 2018-09-11)
- Install pivotal’s tap to add additional software ( such as spring boot CLI ) on Mac.
localhost:~ $ brew tap pivotal/tap Updating Homebrew... ==> Tapping pivotal/tap Cloning into '/usr/local/Homebrew/Library/Taps/pivotal/homebrew-tap'... ......
- Install spring boot CLI use HomeBrew.
localhost:~$ brew install springboot Updating Homebrew...
- Spring boot will be installed in the /usr/local/bin folder.
- Then you can run
spring shellto run spring boot CLI commands.