1

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

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 进行本地安装呢?

4

1 回答 1

3

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

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

例如:

$ unzip -d ~/.sdkman/candidats/groovy ~/Downloads/groovy-2.4.12.zip
$ sdk default groovy 2.4.12 # sdk use ...
于 2021-02-02T22:07:34.157 回答