SDKMAN本地安装

SDKMAN local installation

出于某种我无法理解的原因,我的(研发)公司正在阻止 sdk 安装。如果我手动访问 sdk 下载 link,我会得到

Sorry, you don't have permission to visit this site.
Website blocked
Not allowed to browse MCAS Unsanctioned Apps category
You tried to visit:http://dl.bintray.com/groovy/maven/apache-groovy-sdk-2.4.12.zip

于是我从家里下载了SDKMAN本地安装试试,怎么都失败了

以下只是我尝试过的方法,可以跳过:

$ sdk install groovy ~/Downloads/apache-groovy-sdk-2.4.12.zip
==== INTERNET NOT REACHABLE! ===================================================

 Some functionality is disabled or only partially available.
 If this persists, please enable the offline mode:

   $ sdk offline

================================================================================

Stop! groovy /Users/xxx/Downloads/apache-groovy-sdk-2.4.12.zip is not available while offline.

$ sdk install groovy 2.4.12 ~/Downloads/groovy-2.4.12
==== INTERNET NOT REACHABLE! ===================================================

 Some functionality is disabled or only partially available.
 If this persists, please enable the offline mode:

   $ sdk offline

================================================================================

Stop! groovy 2.4.12 is not available while offline.


$ sdk offline
Offline mode enabled.

$ sdk install groovy 2.4.12 ~/Downloads/apache-groovy-sdk-2.4.12
Stop! groovy 2.4.12 is not available while offline.

$ sdk install groovy ~/Downloads/apache-groovy-sdk-2.4.12.zip
Stop! groovy /Users/xxx/Downloads/apache-groovy-sdk-2.4.12.zip is not available while offline.

$ sdk install groovy ~/Downloads/apache-groovy-sdk-2.4.12
Stop! groovy /Users/xxx/Downloads/apache-groovy-sdk-2.4.12 is not available while offline.

我确定 zip 文件在那里,并让 UTSL 通过自己的检查来验证:

 [[ -n /Users/xxx/Downloads/apache-groovy-sdk-2.4.12.zip ]] 

$ echo $?
0

那么,如何利用我下载的.zip,使用SDKMAN进行本地安装呢?

这在过去对我有用 - 不确定它是否仍然适用。

只需将存档解压到相关的 sdkman 文件夹,并告诉 sdkman 使用它作为默认版本。

例如:

$ unzip -d ~/.sdkman/candidats/groovy ~/Downloads/groovy-2.4.12.zip
$ sdk default groovy 2.4.12 # sdk use ...