Sdkman
sdkman
Better software version management and software environment management than update-alternatives.
update-alternatives can only be used for version control, and sdkman can automatically set the JAVA_HOME environment variable.
Its principle is very simple, it will save all managed software under ~/.sdkman/candidates, and change the PATH variable very roughly to achieve the purpose
#$ sdk current
Using:
java: 14.0.2-zulu
gradle: 6.2.2
Imagine dealing with multiple version of java
# Installing sdkman
$ curl -s "https://get.sdkman.io" | bash
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
# List All SDK Candidates
# The list command shows all the available candidates,
# identified by a unique name, the description, the official website,
# and the installation command
$ sdk list
$ sdk list java
# Install and Manage Java Version
$ sdk install java Identifier # online
$ sdk install java _custome_identifier _path_to_target # localy
# Switching Between Versions
$ sdk use java Identifier # temporarily
$ sdk default java 14.0.1.j9-adpt # permanently
# Remove a Version
$ sdk uninstall java 14.0.1.j9-adpt
# Display the Version in Use
$ sdk current java
$ sdk current
[ref1](Guide to SDKMAN! | Baeldung)
本文作者:ivanohohoh
本文链接:https://www.cnblogs.com/ivanohohoh/p/17796053.html
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步