好用的SDK版本管理工具SDKMAN

作为一名Java后端开发人员,安装开发环境我们再熟悉不过了,如果有一款工具帮助我们自动安装环境,岂不是快哉,今天要介绍的就是一款后端SDK版本管理工具SDKMAN,客官请接好。
image.png

遇到的问题

  1. 换新电脑了,又要重新安装新环境,不同环境需要去各大网站下载、安装和配置;
  2. 临时换环境版本,本地验证,如maven、java的版本等;
  3. 程序本地验证,临时安装中间件程序,如MQ;
  4. 本地性能测试工具管理,如jmeter;

目前支持安装

activemq
ant
asciidoctorj
ballerina
bld
bpipe
btrace
concurnas
connor
coursier
cuba
cxf
detekt
doctoolchain
flink
gaiden
gcn
grace
gradle
gradleprofiler
grails
groovy
groovyserv
hadoop
helidon
http4k
infrastructor
jarviz
java
jbake
jbang
jetty
jikkou
jmc
jmeter
joern
jreleaser
karaf
kcctl
ki
kobweb
kotlin
kscript
ktx
layrry
leiningen
liquibase
maven
mcs
micronaut
mulefd
mvnd
mybatis
neo4jmigrations
pierrot
pomchecker
quarkus
sbt
scala
scalacli
schemacrawler
skeletal
spark
springboot
sshoogr
taxi
tomcat
toolkit
vertx
visualvm
webtau
znai

常用的工具都有的,如gradle、java、jmeter、maven等。

开始安装使用

官方地址:https://sdkman.io/

安装

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

命令行执行自动安装完成,接下来就可以直接使用了。

常用命令

image.png
图中列出来了常用的命令,英文也写的比较清楚,这里我就不一一解释了,以下是我本地的效果。

sdk current java

1
2
3
(base) ➜  ~ sdk current java                                                                                                                          

Using java version 8.0.412-zulu

sdk current

1
2
3
4
5
6
7
(base) ➜  ~ sdk current

Using:

gradle: 6.9.4
java: 8.0.412-zulu
maven: 3.9.6

sdk list

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
================================================================================
Available Candidates
================================================================================
q-quit /-search down
j-down ?-search up
k-up h-help

--------------------------------------------------------------------------------
Apache ActiveMQ (Classic) (5.17.1) https://activemq.apache.org/

Apache ActiveMQ® is a popular open source, multi-protocol, Java-based message
broker. It supports industry standard protocols so users get the benefits of
client choices across a broad range of languages and platforms. Connect from
clients written in JavaScript, C, C++, Python, .Net, and more. Integrate your
multi-platform applications using the ubiquitous AMQP protocol. Exchange
messages between your web applications using STOMP over websockets. Manage your
IoT devices using MQTT. Support your existing JMS infrastructure and beyond.
ActiveMQ offers the power and flexibility to support any messaging use-case.

$ sdk install activemq
--------------------------------------------------------------------------------
Ant (1.10.13) https://ant.apache.org/

Apache Ant is a Java library and command-line tool whose mission is to drive
processes described in build files as targets and extension points dependent
upon each other. The main known usage of Ant is the build of Java applications.
Ant supplies a number of built-in tasks allowing to compile, assemble, test and
run Java applications. Ant can also be used effectively to build non Java
applications, for instance C or C++ applications. More generally, Ant can be
used to pilot any type of process which can be described in terms of targets and
tasks.

$ sdk install ant
--------------------------------------------------------------------------------
下面还有很多!

sdk list java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
================================================================================                                                                      
Available Java Versions for macOS ARM 64bit
================================================================================
Vendor | Use | Version | Dist | Status | Identifier
--------------------------------------------------------------------------------
Corretto | | 22.0.1 | amzn | | 22.0.1-amzn
| | 21.0.3 | amzn | | 21.0.3-amzn
| | 17.0.11 | amzn | | 17.0.11-amzn
| | 11.0.23 | amzn | | 11.0.23-amzn
| | 8.0.412 | amzn | | 8.0.412-amzn
Gluon | | 22.1.0.1.r17 | gln | | 22.1.0.1.r17-gln
| | 22.1.0.1.r11 | gln | | 22.1.0.1.r11-gln
GraalVM CE | | 22.0.1 | graalce | | 22.0.1-graalce
| | 21.0.2 | graalce | | 21.0.2-graalce
| | 17.0.9 | graalce | | 17.0.9-graalce
GraalVM Oracle| | 23.ea.10 | graal | | 23.ea.10-graal
| | 23.ea.9 | graal | | 23.ea.9-graal
| | 22.0.1 | graal | | 22.0.1-graal
| | 21.0.3 | graal | | 21.0.3-graal
| | 17.0.11 | graal | | 17.0.11-graal
Java.net | | 23.ea.25 | open | | 23.ea.25-open
| | 23.ea.24 | open | | 23.ea.24-open
| | 22 | open | | 22-open
| | 21.0.2 | open | | 21.0.2-open
JetBrains | | 21.0.3 | jbr | | 21.0.3-jbr
| | 17.0.11 | jbr | | 17.0.11-jbr
| | 11.0.14.1 | jbr | | 11.0.14.1-jbr
下面还有很多!

使用感受

谁用谁知道哈哈!

评论