sdkman on cygwin can't install

Viewed 3978

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.

3 Answers

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

Recently I had the very same problem, and the reason was very simple... I forgot to install cURL on my Cygwin. Hope it helps!

I had the same problem recently and I manage to make it work somehow.

In the sdkman source file, I modified the .sdkman/src/sdkman-install.sh line 150.

I replaced the "--output" of the line below by a classic redirection ">". After I just restarted cygwin and the command finally worked.

__sdkman_secure_curl_download "${download_url}" --output "${binary_input}"

Hope that helps !

Related