Question
I was following the documentation to install on Windows. I'm using Windows 10 on Appveyor.
I installed WSL 1.
However, this fails:
source "/c/Users/appveyor/.sdkman/bin/sdkman-init.sh"
With error:
'source' is not recognized as an internal or external command,
I'm not quiet sure why. Bash seems to be installed.
System info
Windows 10 x64 VM on Appveyor.
Hi @stephanmg,
It is very difficult to tell what is going wrong with the little information you have given.
However, the fact that it is failing by not knowing what source is makes me think that you are trying to run it in a windows cmd shell, not a cygwin (or WSL) shell. It would be helpful if you could paste the exact procedure that you followed, plus any console output that you see when installing.
@marc0der you are right. I provided definitely too little detail.
Here is my installation routine with error logs:
https://ci.appveyor.com/project/stephanmg/branch-generator/builds/33843154
It seems like your install.sh is not finding the files installed in the previous (installation) step. Have you tried running install.sh locally first in a bash terminal?
If it behaves the same locally it would be a problem with the script, else you might need to take it up with the AppVeyor community.
Update: Got it working via:
curl -s "https://get.sdkman.io" > install.sh
bash -c "install.sh; cd /c/Users/appveyor/.sdkman/bin/; source sdkman-init.sh"
However the result is:
FIND: Parameter format not correct
sdkman-init.sh: line 113: __sdkman_echo_debug: command not found
It seems, that the Windows FIND command is picked up. Can we prefix this with "builtin"? Or potentially one could just use a traditional for loop for the line 80 in sdkman-init.sh: scripts=($(find "${SDKMAN_DIR}/src" "${SDKMAN_DIR}/ext" -type f -name 'sdkman-*')).
Right now I do not have a Windows installation at my hands. Thus I cannot test it. In the install script once checks for cygwin but not for WSL. I checked and the files exist.
@stephanmg would you mind sharing how you resolved this for the benefit of others who might face the same issue?
@marc0der sure. But I think I was rather not using WSL correctly, here is my CI script for Appveyor:
image: Visual Studio 2019
install:
- dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
- wsl sudo apt-get update
- wsl sudo apt-get install -y zip
- curl -s "https://get.sdkman.io" | wsl bash
- wsl source "/home/appveyor/.sdkman/bin/sdkman-init.sh"
- wsl bash -c "echo source /home/appveyor/.bashrc >> /home/appveyor/.bash_profile"
- wsl bash -c "echo source /home/appveyor/.bashrc >> /home/appveyor/.profile"
- ps: wsl bash -c "source /home/appveyor/.sdkman/bin/sdkman-init.sh && sdk install kotlin &> /dev/null"
environment:
JAVA_HOME: C:\Program Files (x86)\Java\jdk1.8.0
Feel free to close this issue.
Thanks for the update!
Thank you for your help @marc0der. Really appreciate this.