Search code examples
sdkman

SDKMAN - Is it possible to download sdks manually for installation


When I try to install an SDK (e.g. visualvm) using sdkman, download takes very long time (more than 1 hour). I was able to download zip directly from source much faster with tor browser.

Is it possible to configure sdkman to use local zip for installation instead of downloading the archive from source?

I've copied downloaded archive to ~/.sdkman/tmp and ~/.sdkman/archives folders. But when I try to install, sdkman tries to download the file again.


Solution

  • I am able to make it work by copying the downloaded archive to ~/.sdkman/tmp folder and changing the name to what is expected by sdkman

    For visualvm:

    ~/.sdkman/tmp$ cp /mnt/c/Users/user123/Downloads/visualvm_202.zip .
    ~/.sdkman/tmp$ mv visualvm_202.zip visualvm-2.0.2.bin
    

    For micronaut:

    ~/.sdkman/tmp$ cp /mnt/c/Users/user123/Downloads/micronaut-1.3.5.zip .
    ~/.sdkman/tmp$ mv micronaut-1.3.5.zip micronaut-1.3.5.bin
    

    How to find the file name sdkman is expecting:

    • Try to install SDK usually with sdk install visualvm 2.0.2
    • If downloading SDK is too slow, abort the installation process with ctrl + c
    • ls ~/.sdkman/tmp and you can see the filename sdkman is trying to download

    Please suggest if there is any simpler and better approach