SDKMAN的安装与卸载

[官方网站](Installation - SDKMAN! the Software Development Kit Manager)

Installing SDKMAN! on UNIX-like platforms is as easy as ever. SDKMAN! installs smoothly on Mac OSX, Linux, WLS, Cygwin, Solaris and FreeBSD. We also support Bash and ZSH shells.
Simply open a new terminal and enter: 

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

Follow the instructions on-screen to complete installation.
Next, open a new terminal or enter:

$ source "$HOME/.sdkman/bin/sdkman-init.sh"

Lastly, run the following code snippet to ensure that installation succeeded:

$ sdk version

If all went well, the version should be displayed. Something like:

  sdkman 5.0.0+51

Windows Installation

Several options exist for installing SDKMAN! on Windows today.

The first solution involves installing Windows Linux Subsystem (WLS) prior to attempting SDKMAN installation. You need a basic toolchain including bash, zip, unzip, and curl (tar and gzip required for special cases). Most likely it will work out of the box.

Another solution involves installing Cygwin prior to attempting SDKMAN installation. For our software to function, we require that Cygwin is installed with the same toolchain as described for WLS.

The third solution is for Git users using the Git Bash for Windows environment. In order for this to work, the environment needs to be supplemented with MinGW to add the necessary toolchain to function.

Please be aware that as SDKMAN is written in bash, it requires a bash environment to be present. SDKMAN can not be installed natively on Windows and requires WLS, Cygwin or MSYS+MinGW.

Beta Channel

For the more adventurous among us, we have a beta channel. All new CLI features will first be rolled out to this group of users for trial purposes. Beta versions can be considered stable for the most part, but might occasionally break. To join the beta program, simply update the the ~/.sdkman/etc/config file as follows:

sdkman_beta_channel=true

Next, open a new terminal and perform a forced update with:

$ sdk selfupdate force

To leave the beta channel, simply set the above config back to false and follow the same procedure.

Uninstallation

In the unlikely event that you would like to uninstall SDKMAN!, we don't have an automated way of doing this yet. If you really do want to remove it from your system, it is very easy to do so.The following will guide you through backing up, then removing the entire installation from your system.


tar zcvf ~/sdkman-backup_$(date +%F-%kh%M).tar.gz -C ~/ .sdkman
$ rm -rf ~/.sdkman

The last step involves editing and removing the initialisation snippet from your .bashrc.bash_profile and/or .profile files. If you use ZSH, remove it from the .zshrc file. The snippet of code to be removed looks something like this:


#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
[[ -s "/home/dudette/.sdkman/bin/sdkman-init.sh" ]] && source "/home/dudette/.sdkman/bin/sdkman-init.sh"

Once removed, you have successfully uninstalled SDKMAN! from your machine.

Installing to a Custom Location

It is possible to install SDKMAN! to a custom location other than $HOME/.sdkman. This can be achieved by exporting your custom location as SDKMAN_DIR prior to installing.
Simply open a new terminal and enter:

$ export SDKMAN_DIR="/usr/local/sdkman" && curl -s "https://get.sdkman.io" | zsh

For this to work it is vital that your user has full access rights to this folder.It is also important that the folder does not exist as SDKMAN! will attempt to create it.

That's all there is to it! Next we will look at Usage.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值