coursier / coursier

Pure Scala Artifact Fetching
https://get-coursier.io
Apache License 2.0
2.02k stars 301 forks source link

cs sbt scala-cli doesn't work properly on windows #2984

Open lvyuemeng opened 1 month ago

lvyuemeng commented 1 month ago

OS: Windows 11 24H2

cs This version of C:\Users\%username%\AppData\Local\Coursier\data\bin.cs.aux.exe is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher.

The same issue persists even when directly accessing cs.exe instead of cs.aux.exe. cs, scala, scala-cli are with the same problem. I switched to the jar-based version of coursier, which works fine, but most of features are lost due to the problem.

the additional problem is about sbt

java.nio.file.InvalidPathException: Illegal char <?> at index 9: C:\Users\??????\.sbt\1.0\java9-rt-ext-oracle_corporation_22_0_1\rt.jar
        at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:204)
        at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:175)
        at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
        at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:231)
        at java.base/java.nio.file.Path.of(Path.java:148)
        at java.base/java.nio.file.Paths.get(Paths.java:69)
        at xsbt.boot.Launch$.exportRt(Launch.scala:53)
        at xsbt.boot.Launch$.apply(Launch.scala:28)
        at xsbt.boot.Launch$.apply(Launch.scala:21)
        at xsbt.boot.Boot$.runImpl(Boot.scala:78)
        at xsbt.boot.Boot$.run(Boot.scala:73)
        at xsbt.boot.Boot$.main(Boot.scala:21)
        at xsbt.boot.Boot.main(Boot.scala)
[error] [launcher] error during sbt launcher: java.nio.file.InvalidPathException: Illegal char <?> at index 9: C:\Users\??????\.sbt\1.0\java9-rt-ext-oracle_corporation_22_0_1\rt.jar

when sbt is being executed.

the template initialization same doesn't work.

java.lang.NoClassDefFoundError: giter8/Runner
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1023)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
        at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524)
        at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427)
        at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:714)
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:529)
        at java.base/java.lang.Class.forName(Class.java:508)
        at giter8.LauncherProcessor.getInterfaceClass(LauncherMain.scala:119)
        at giter8.LauncherProcessor.call(LauncherMain.scala:108)
        at giter8.LauncherProcessor.virtuallyRun(LauncherMain.scala:86)
        at giter8.LauncherProcessor.process(LauncherMain.scala:38)
        at giter8.Runner.$anonfun$run$9(Runner.scala:50)
        at scala.util.Either.flatMap(Either.scala:341)
        at giter8.Runner.$anonfun$run$5(Runner.scala:47)
        at scala.util.Either.flatMap(Either.scala:341)
        at giter8.Runner.$anonfun$run$4(Runner.scala:46)
        at scala.util.Either.flatMap(Either.scala:341)
        at giter8.Runner.run(Runner.scala:45)
        at giter8.Runner.run(Runner.scala:71)
        at sbtgiter8resolver.Giter8TemplateResolver.run(Giter8TemplateResolver.scala:34)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at sbt.TemplateCommandUtil$.call(TemplateCommandUtil.scala:131)
        at sbt.TemplateCommandUtil$.runTemplate(TemplateCommandUtil.scala:106)
        at sbt.TemplateCommandUtil$.$anonfun$run$1(TemplateCommandUtil.scala:82)
        at sbt.TemplateCommandUtil$.$anonfun$run$1$adapted(TemplateCommandUtil.scala:78)
        at scala.collection.LinearSeqOptimized.find(LinearSeqOptimized.scala:115)
        at scala.collection.LinearSeqOptimized.find$(LinearSeqOptimized.scala:112)
        at scala.collection.immutable.List.find(List.scala:91)
        at sbt.TemplateCommandUtil$.run(TemplateCommandUtil.scala:78)
        at sbt.TemplateCommandUtil$.runTemplate(TemplateCommandUtil.scala:63)
        at sbt.TemplateCommandUtil$.$anonfun$templateCommand0$2(TemplateCommandUtil.scala:31)
        at sbt.Command$.$anonfun$applyEffect$4(Command.scala:151)
        at sbt.Command$.$anonfun$applyEffect$2(Command.scala:146)
        at sbt.Command$.process(Command.scala:190)
        at sbt.MainLoop$.$anonfun$processCommand$5(MainLoop.scala:246)
        at scala.Option.getOrElse(Option.scala:189)
        at sbt.MainLoop$.process$1(MainLoop.scala:246)
        at sbt.MainLoop$.processCommand(MainLoop.scala:277)
        at sbt.MainLoop$.$anonfun$next$5(MainLoop.scala:164)
        at sbt.State$StateOpsImpl$.runCmd$1(State.scala:290)
        at sbt.State$StateOpsImpl$.process$extension(State.scala:326)
        at sbt.MainLoop$.$anonfun$next$4(MainLoop.scala:164)
        at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24)
        at sbt.MainLoop$.next(MainLoop.scala:164)
        at sbt.MainLoop$.run(MainLoop.scala:145)
        at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:120)
        at sbt.io.Using.apply(Using.scala:28)
        at sbt.MainLoop$.runWithNewLog(MainLoop.scala:113)
        at sbt.MainLoop$.runAndClearLast(MainLoop.scala:67)
        at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:52)
        at sbt.MainLoop$.runLogged(MainLoop.scala:43)
        at sbt.StandardMain$.runManaged(Main.scala:225)
        at sbt.xMain$.$anonfun$run$9(Main.scala:115)
        at sbt.io.IO$.withTemporaryDirectory(IO.scala:496)
        at sbt.io.IO$.withTemporaryDirectory(IO.scala:506)
        at sbt.xMain$.run(Main.scala:102)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at sbt.internal.XMainConfiguration.run(XMainConfiguration.java:59)
        at sbt.xMain.run(Main.scala:47)
        at xsbt.boot.Launch$.$anonfun$run$1(Launch.scala:149)
        at xsbt.boot.Launch$.withContextLoader(Launch.scala:176)
        at xsbt.boot.Launch$.run(Launch.scala:149)
        at xsbt.boot.Launch$.$anonfun$apply$1(Launch.scala:44)
        at xsbt.boot.Launch$.launch(Launch.scala:159)
        at xsbt.boot.Launch$.apply(Launch.scala:44)
        at xsbt.boot.Launch$.apply(Launch.scala:21)
        at xsbt.boot.Boot$.runImpl(Boot.scala:78)
        at xsbt.boot.Boot$.run(Boot.scala:73)
        at xsbt.boot.Boot$.main(Boot.scala:21)
        at xsbt.boot.Boot.main(Boot.scala)
Caused by: java.lang.ClassNotFoundException: giter8.Runner
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
        ... 78 more

I can't ensure the relations about these problems since I reinstalled many times or switched to various versions of java and eventually failed.

lvyuemeng commented 1 month ago

2953