Scala failed to install on Windows 10

I used this site to install Scala on latest version of Windows 10 Pro. The installer started and successfully completed the following steps (shown at the end below). At the end, command window asked: Press ENTER to continue…

However, when I pressed ENTER, the command window disappeared and nothing happened. I waited for more than 5 minutes but nothing came back. I checked my installed apps, and scala is not there. If I type scala on the command prompt, it does not recognize it. I checked the installation of Java as follows and Java is there. I have Spark installed on Windows and it works fine:

PS C:\Users\mylogin> cs java-home
C:\Program Files\Java\jdk-1.8
PS C:\Users\mylogin>

Following is the process that completed successfully when installing scala:

Checking if a JVM is installed
Found a JVM installed under C:\Program Files\Java\jdk-1.8.

Checking if ~\AppData\Local\Coursier\data\bin is in PATH
Should we add ~\AppData\Local\Coursier\data\bin to your PATH? [Y/n] Y

Checking if the standard Scala applications are installed
Found ammonite
Found cs
Found coursier
Found scala
Found scalac
Found scala-cli
Found sbt
Found sbtn
Found scalafmt

Press ENTER to continue…

1 Like

Welcome to the Scala community @Saf

I believe that’s normal? The message could be clearer though, like “installation finished successfully, now the window will close, you can use it with …” etc.

Yes, I believe it does not get added to your Start Menu as an “app”, because everything that’s installed are command-line tools. I’m not a Windows user and it’s been many years since I last used it, but I think that’s how it is.

This might be a PATH issue. Maybe it’s a bug with the installer? Can you report here? Issues · coursier/coursier · GitHub

1.8 is ancient at this point, at least Java 17 is the way to go. Coursier should reject 1.8 to be honest…
I recommend using cs to install Java 17. For example:

cs java --jvm zulu:17.0.11
1 Like

@spamegg1 It seems Windows 10 needed a reboot for the Scala installation to work. After a reboot of the system, installation worked as I tested below:

PS C:\Users\mylogin> scala -version
Scala code runner version 3.4.2 – Copyright 2002-2024, LAMP/EPFL
PS C:\Users\mylogin> scala
Welcome to Scala 3.4.2 (1.8.0_401, Java Java HotSpot™ 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.

scala>

Thanks to @spamegg1 for looking on the issue and explaining that the installation succeeded as expected.

My Two Cents to Scala team:

  1. Maybe add a note to the installation document for Windows: In some cases, you may have to restart windows before testing the installation
  2. The last command of the installation windows reads: Press ENTER to continue…
    This last command may be misleading to some - as it gives an impression that you will see the next step of the installation after you press ENTER. Maybe, we should instead add something similar to:

Press ENTER to exit…

1 Like

Yes I’m not sure how the PATH is updated on Windows, but probably a logout / login would also work.

Glad it worked out. Agreed on the confusing messaging, it’s a universal problem in free open source software everywhere :smiley: (since you don’t use Linux you’re probably not aware)

Tiresomely, sdkman says to open a new terminal window.

should say

Abandon all hope, ye who ENTER here...
1 Like