Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 710
Philip Avatar asked Jun 08 '19 19:06

Philip


People also ask

Does Sdkman work on Windows?

Please be aware that as SDKMAN is written in bash, it requires a bash environment to be present. SDKMAN can not be installed natively on Windows and requires WSL, Cygwin or MSYS+MinGW.

Where is Sdkman installed?

The installed SDKs are stored in the SDKMAN! directory which defaults to ~/. sdkman/candidates.


2 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
like image 144
Philip Avatar answered Oct 14 '22 04:10

Philip


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

like image 4
Daniel Engel Avatar answered Oct 14 '22 03:10

Daniel Engel