How To Install Spring Boot CLI On Mac, Linux And Windows

Spring boot CLI is a spring command line tool which can help you develop spring application quickly and easily. It utilize spring’s start dependence and automation configuration features, then developer can focus on the business logic code, do 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.

  1. Go to spring boot getting started and installation page and download
    download spring boot cli install software web page
  2. Unzip the downloaded file to a local folder. You can find there is a bin folder under it. There are two executable file, one is spring( for Mac or Linux ) the other is spring.bat( for Windows ).
    spring boot cli tool contained file structure
  3. Open a terminal and execute below command to add above bin folder to 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
  4. To verify spring boot cli installation correctly, run spring --version in terminal.
    localhost:~ $ spring --version
    Spring CLI v2.0.2.RELEASE
  5. Run spring boot CLI shell. You can run commands in spring boot cli shell, you can execute a lot of CLI command in the shell and press TAB key to auto complete cli shell commands.
    $spring shell

2. Install Spring Boot CLI On MacOS Use HomeBrew.

  1. 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)
  2. 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'...
  3. Install spring boot cli use HomeBrew.

    localhost:~$ brew install springboot
    Updating Homebrew...
  4. Spring boot will be installed in /use/local/bin folder.

  5. Then you can run spring --version or spring shell to run spring boot cli commands.

0 0 votes
Article Rating
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x