Search code examples
windows-10cygwinsdkman

sdkman on cygwin can't install


I'm setting up a new machine and installing sdkman on Cygwin to install Java. I had this exact setup working on my previous machine, also Win 10.

Installed Cygwin, and required for sdkman, installed zip and unzip packages. Now I'm getting the following error:

$ sdk i java 11.0.3-zulu

Downloading: java 11.0.3-zulu

In progress...

Warning: Failed to create the file
Warning: /home/whyph/.sdkman/tmp/D2txrZkztdcZKSIltTtxclUhHkzF9yIf.bin: No such
Warning: file or directory

curl: (23) Failed writing body (0 != 14095)
mv: cannot stat '/home/whyph/.sdkman/tmp/D2txrZkztdcZKSIltTtxclUhHkzF9yIf.bin': No such file or directory

Tried disabling Windows firewall and running Cygwin as administrator, neither changed the error. Worked out of the box on my last machine, but can't figure out what might be different.


Solution

  • I discovered the problem - wrong curl. Turns out, Windows 10 now comes with curl and it's on your path. I assumed it was one of the base packages of Cygwin, but it is not, and the Windows version is not compatible with SDKMAN, even though it worked to install it. Fix:

    1. Remove SDKMAN per https://sdkman.io/install Uninstallation section
    2. Close Cygwin shells
    3. Rerun Cygwin setup and insure the curl, zip, unzip, and tar packages are installed (check installation instructions in case more dependencies are added since this writing)
    4. Install SDKMAN per instructions