macOS 下安装SDKMAN 软件开发工具包管理器

SDKMAN 软件开发工具包管理器的安装非常简单,只需要打开终端,执行:

$ curl -s "https://get.sdkman.io" | bash

就OK了,输出类似如下:

Thanks for using...                                            		         

     SSSSSSSSSSSSSSS DDDDDDDDDDDDD       KKKKKKKKK    KKKKKKK
   SS:::::::::::::::SD::::::::::::DDD    K:::::::K    K:::::K
  S:::::SSSSSS::::::SD:::::::::::::::DD  K:::::::K    K:::::K
  S:::::S     SSSSSSSDDD:::::DDDDD:::::D K:::::::K   K::::::K
  S:::::S              D:::::D    D:::::DKK::::::K  K:::::KKK
  S:::::S              D:::::D     D:::::D K:::::K K:::::K
   S::::SSSS           D:::::D     D:::::D K::::::K:::::K
    SS::::::SSSSS      D:::::D     D:::::D K:::::::::::K
      SSS::::::::SS    D:::::D     D:::::D K:::::::::::K
         SSSSSS::::S   D:::::D     D:::::D K::::::K:::::K
              S:::::S  D:::::D     D:::::D K:::::K K:::::K
              S:::::S  D:::::D    D:::::DKK::::::K  K:::::KKK
  SSSSSSS     S:::::SDDD:::::DDDDD:::::D K:::::::K   K::::::K
  S::::::SSSSSS:::::SD:::::::::::::::DD  K:::::::K    K:::::K
  S:::::::::::::::SS D::::::::::::DDD    K:::::::K    K:::::K
   SSSSSSSSSSSSSSS   DDDDDDDDDDDDD       KKKKKKKKK    KKKKKKK                  

                      mmmmmmm    mmmmmmm     aaaaaaaaaaaaa  nnnn  nnnnnnnn
                    mm:::::::m  m:::::::mm   a::::::::::::a n:::nn::::::::nn
                   m::::::::::mm::::::::::m  aaaaaaaaa:::::an::::::::::::::nn
                   m::::::::::::::::::::::m           a::::ann:::::::::::::::n
                   m:::::mmm::::::mmm:::::m    aaaaaaa:::::a  n:::::nnnn:::::n
                   m::::m   m::::m   m::::m  aa::::::::::::a  n::::n    n::::n
                   m::::m   m::::m   m::::m a::::aaaa::::::a  n::::n    n::::n
                   m::::m   m::::m   m::::ma::::a    a:::::a  n::::n    n::::n
                   m::::m   m::::m   m::::ma::::a    a:::::a  n::::n    n::::n
                   m::::m   m::::m   m::::ma:::::aaaa::::::a  n::::n    n::::n
                   m::::m   m::::m   m::::m a::::::::::aa:::a n::::n    n::::n
                   mmmmmm   mmmmmm   mmmmmm  aaaaaaaaaa  aaaa nnnnnn    nnnnnn 

                                                 Now attempting installation...

Looking for a previous installation of SDKMAN...
Looking for unzip...
Looking for zip...
Looking for curl...
Looking for sed...
Installing SDKMAN scripts...
Create distribution directories...
Getting available candidates...
Prime the config file...
Download script archive...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:03 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:06 --:--:--     0
100 20838  100 20838    0     0   2331      0  0:00:08  0:00:08 --:--:-- 20290
Extract script archive...
Install scripts...
Set version to 5.5.9+231 ...
Updated existing /Users/aven/.bashrc
Attempt update of zsh profiles...
Updated existing /Users/aven/.zshrc

All done!

Please open a new terminal, or run the following in the existing one:

    source "/Users/aven/.sdkman/bin/sdkman-init.sh"

Then issue the following command:

    sdk help

Enjoy!!!

然后根据命令输出最后的提示执行类似命令:

source "/Users/aven/.sdkman/bin/sdkman-init.sh"

注意:你在命令输出中到的提示命令可能与我的不完全相同,至少我们的用户名不相同。

执行完成之后,“sdk”命令就可以使用了:

$ sdk
==== BROADCAST =================================================================
* 29/07/17: Scala 2.12.3 released on SDKMAN! #scala
* 27/07/17: Springboot 1.5.6.RELEASE released on SDKMAN! #springboot
* 26/07/17: Springboot 2.0.0.M3 released on SDKMAN! #springboot
================================================================================

Usage: sdk <command> [candidate] [version]
       sdk offline <enable|disable>

   commands:
       install   or i    <candidate> [version]
       uninstall or rm   <candidate> <version>
       list      or ls   [candidate]
       use       or u    <candidate> [version]
       default   or d    <candidate> [version]
       current   or c    [candidate]
       upgrade   or ug   [candidate]
       version   or v
       broadcast or b
       help      or h
       offline           [enable|disable]
       selfupdate        [force]
       flush             <candidates|broadcast|archives|temp>

   candidate  :  the SDK to install: groovy, scala, grails, gradle, kotlin, etc.
                 use list command for comprehensive list of candidates
                 eg: $ sdk list

   version    :  where optional, defaults to latest stable if not provided
                 eg: $ sdk install groovy

否则你将看到以下提示:

$ sdk
-bash: sdk: command not found

找不到“sdk”命令。

好了,就是安装命令输出所说,Enjoy!!!

相关阅读:

《gradle 用户指南中文版》目录

上一篇:ubuntu server 时区设置问题解决


下一篇:使用ajax方法实现form表单的提交