Open ekrich opened 8 months ago
Update:
I am using sbt/java/scala-cli via git bash on windows. When I try to use scala-cli it can't find my java. I am wondering if the path separators are causing problems. When I do the outputted command it works.
$ scala-cli`
...
Downloaded https://repo1.maven.org/maven2/org/scala-lang/scala3-sbt-bridge/3.4.2/scala3-sbt-bridge-3.4.2.jar
Error: java.io.IOException: Cannot run program "C:\Users\<user>\.sdkman\candidates\java\current\bin\java.exe" (in directory "C:\Users\<user>"): CreateProcess error=2, The system cannot find the file specified
For more details, please see 'C:\Users\<user>\.scala-build\stacktraces\1717621793-3759065945745879396.log'
$ "C:\Users\<user>\.sdkman\candidates\java\current\bin\java.exe" --version
openjdk 17.0.8.1 2023-08-24
OpenJDK Runtime Environment Temurin-17.0.8.1+1 (build 17.0.8.1+1)
OpenJDK 64-Bit Server VM Temurin-17.0.8.1+1 (build 17.0.8.1+1, mixed mode, sharing)
Maybe use the env var MSYSTEM_PREFIX=mingw64
to prepare the Java path?
Or escape double quote the path to preserve the backslashes. This is all speculation but maybe some ideas for someone familiar with the code base.
Path is reported as /C/User/...
in the PATH env var or when using which java unlike the normal windows path listed above.
If the path is not quoted you get the following so this could be a hint:
$ C:\Users\<user>\.sdkman\candidates\java\current\bin\java.exe
bash: C:Users<user>.sdkmancandidatesjavacurrentbinjava.exe: command not found
Version(s) 1.0.4
Describe the bug Because I am unable to install
scala-cli
using the unsigned installer or other means I have resorted tosdkman
.sdkman
mostly works on Windows using Git Bash.scala-cli
seems that is trying to use windows path (see To Reproduce section) versus UNIX like path which would be as follows:This works.
To Reproduce Note: when installing the final copy step fails so you need to do the final copy and rename of
sdkman
install of each component. symlinkcurrent
does work after the copy as seen above.Install git bash Install sdkman Install java 17 using sdkman install scala-cli
Expected behaviour Would like
scala-cli
to work in git bash.scala-cli
will run in both command shell and power shell although the coloring does not work well in powershell. In Command window and Power Shell it will work using another Java in the path. Can't usecurrent
link in that case.