Hey! While doing a new installation of scala on fedora with coursier, it seems to have installed Scala 3.5.0 with scala-cli 1.4.3, and therefore it throws the warning:
[warning] MainGenericRunner class is deprecated since Scala 3.5.0, and Scala CLI features will not work.
[warning] Please be sure to update to the Scala CLI launcher to use the new features.
[warning] It appears that your Coursier-based Scala installation is misconfigured.
[warning] To update to the new Scala CLI runner, please update (coursier, cs) commands first before re-installing scala.
[warning] Check the Scala 3.5.0 release notes to troubleshoot your installation.
Scala code runner version 3.5.0 -- Copyright 2002-2024, LAMP/EPFL
Perhaps it is due to the pending release process of 3.5.0. As I understand it you cannot use the new scala runner with scala for instance scala repl -S 3.5.0 or scala run . ? @Annie-Wb
Are there more of you out there that have this issue?
This is expected to happen if you are using an old Coursier version.
This is because earlier versions did not support installing native packages, so it defaults to the old runner JAR.
Blockquote
[warning] To update to the new Scala CLI runner, please update (coursier, cs) commands first before re-installing scala.
Do note that this is also explained in the actual warning you are getting.
Aha - many thanks for explanation. How to install a newer cs ? I assume @lego-eden and @Annie-Wb installet it from the current scala-lang and cs update does not seem to help (but that maybe changes now that home page has changed?).
before you do the whole thing all over from the official page including an important-not-to-forget reboot to be sure path stuff gets activated. Your troubles were probably due to that you installed in the middle of the release process with some transient inconsistencies… (Also note that if you are using other package managers such as brew or sdkman they may interfere with cs and you may have to uninstall scala-related stuff in your other package manager in order to allow cs to pick up your scala if that is what you want – or you can just keep on using brew or sdkam as scala 3.5.0 is just now also available from there )
Please report back here @Annie-Wb@lego-eden if you get it all to work for you on your specific platform after uninstalling and reinstalling and reboot. Thanks again for reporting!
So, after Scala 3.5.0 has been released, I tried to uninstall everything with cs uninstall --all, then reinstalled using the curl string in Install | The Scala Programming Language, ran cs update then both scala --version and scala-cli --version and the results are the same, as follows
annie@annie-thinkpad ~> cs update
https://repo1.maven.org/maven2/com/lihaoyi/ammonite_3.4.2/maven-metadata.xml
No new update since 2024-07-18 00:10:48
https://repo1.maven.org/maven2/com/google/code/gson/gson/maven-metadata.xml
No new update since 2024-05-19 21:00:04
https://repo1.maven.org/maven2/io/get-coursier/coursier-cli_2.13/maven-metadata.xml
No new update since 2024-05-06 15:20:32
https://repo1.maven.org/maven2/io/get-coursier/coursier-cli_2.13/maven-metadata.xml
No new update since 2024-05-06 15:20:32
https://repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/maven-metadata.xml
No new update since 2024-08-22 06:38:57
https://repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/maven-metadata.xml
No new update since 2024-08-22 06:38:57
https://repo1.maven.org/maven2/org/scalameta/scalafmt-cli_2.13/maven-metadata.xml
No new update since 2024-07-25 13:17:59
annie@annie-thinkpad ~> scala --version
[warning] MainGenericRunner class is deprecated since Scala 3.5.0, and Scala CLI features will not work.
[warning] Please be sure to update to the Scala CLI launcher to use the new features.
[warning] It appears that your Coursier-based Scala installation is misconfigured.
[warning] To update to the new Scala CLI runner, please update (coursier, cs) commands first before re-installing scala.
[warning] Check the Scala 3.5.0 release notes to troubleshoot your installation.
Scala code runner version 3.5.0 -- Copyright 2002-2024, LAMP/EPFL
annie@annie-thinkpad ~> scala-cli --version
Scala CLI version: 1.4.3
Scala version (default): 3.4.2
Thanks! So the problem remains or re-appeared, unfortunately. I will do some more testing and also discuss at Contributors and get back here as soon as I got some clue of what is going on.
Anybody else get it to work without warning or not?
I installed Coursier with the installation guide on their website, then installed scala and scala-cli. I got the same warnings as @Annie-Wb when checking scala --version.
However, scala-cli still seems to work and could do scala-cli run . on a project in scala 3.5.