1. 第一步 安装软件
# 第一步 使用如下命令安装软件 ,国内网络可能不通,可以使用VPN
$ curl -s "https://get.sdkman.io" | bash
2. 第二步 常用命令
# 安装软件 sdk install 软件名 [版本号 | 可以不写版本号]
$ sdk install or i <candidate> [version]
# uninstall pkg 卸载软件
$ sdk uninstall or rm <candidate> <version>
# list avaliable pkg 列出可用软件
$ sdk list or ls [candidate]
# 没有过
$ sdk use or u <candidate> [version]
$ sdk default or d <candidate> [version]
$ sdk current or c [candidate]
# 软件升级 如 sdk java
$ sdk upgrade or ug [candidate]
# show current version of sdk manager
$ sdk version or v
$ sdk broadcast or b
$ sdk help or h
# 启用离线模式
$ sdk offline [enable|disable]
$ sdk selfupdate [force]
# sdk升级
$ sdk update
$ sdk flush <broadcast|archives|temp>
3. 操作演示
# 列出可用的java包
MacdeMacBook-Pro:Homebrew mac$ sdk list java
================================================================================
Available Java Versions
================================================================================
12.ea.20-open
11.0.1-zulu
11.0.1-open
10.0.2-zulu
10.0.2-open
9.0.7-zulu
9.0.4-open
8.0.192-zulu
8.0.191-oracle
7.0.181-zulu
1.0.0-rc9-graal
1.0.0-rc8-graal
1.0.0-rc7-graal
================================================================================
+ - local version
* - installed
> - currently in use
================================================================================
# 安装Java1.8
MacdeMacBook-Pro:Homebrew mac$ sdk install java 8.0.191-oracle
Oracle requires that you agree with the Oracle Binary Code License Agreement
prior to installation. The license agreement can be found at:
http://www.oracle.com/technetwork/java/javase/terms/license/index.html
Do you agree to the terms of this agreement? (Y/n): Y
Downloading: java 8.0.191-oracle
In progress...
################################### 100.0%
We will be needing super powers...
Password:
Repackaging Java 8u191...
Attaching to the DMG...
Mounting DMG as Volume...
Volume(s) mounted successfully
Installing PKG inside DMG...
installer: Package name is JDK 8 Update 191
installer: Installing at base path /
installer: The install was successful.
Copy JDK Home to temp folder...
Preparing archive...
Unmounting volume...
"/Volumes/JDK 8 Update 191" unmounted successfully.
Done repackaging...
Cleaning up cookie...
Installing: java 8.0.191-oracle
Done installing!
Setting java 8.0.191-oracle as default.
# 安装完毕,查看Java版本,是不是觉得非常方便啊
MacdeMacBook-Pro:Homebrew mac$ java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
4. 官网简介
The Software Development Kit Manager
SDKMAN! is a tool for managing parallel versions of multiple Software Development Kits on most Unix based systems. It provides a convenient Command Line Interface (CLI) and API for installing, switching, removing and listing Candidates. Formerly known as GVM the Groovy enVironment Manager, it was inspired by the very useful RVM and rbenv tools, used at large by the Ruby community.
Multi-platform 多平台支持
Runs on any UNIX based platforms: Mac OSX, Linux, Cygwin, Solaris and FreeBSD.
Get started now! 安装简便
Go on, paste and run the following in a terminal:
$ curl -s "https://get.sdkman.io" | bash
Java all the way down 支持Java/Groovy/Scala/Kotlin等等安装,无须麻烦的配置
Install Software Development Kits for the JVM such as Java, Groovy, Scala, Kotlin and Ceylon. Ant, Gradle, Grails, Maven, SBT, Spark, Spring Boot, Vert.x and many others also
Lightweight 轻量级
Written in bash and only requires curl and zip/unzip to be present on your system. Even works with ZSH too.
APIs 支持REST API
New Clients can easily be written by consuming our open Broker REST API. Vendors can publish and announce their own releases through a secure Vendor API.
By Developers, for Developers
Making life easier. No more trawling download pages, extracting archives, messing with _HOME and PATHenvironment variables.