scalasbtintellij-14

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: The command window disappaers when I hit ENTER. And nothing happens afterwards.

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…

Solution

  • 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(TM) 64-Bit Server VM).
    > Type in expressions for evaluation. Or try :help.
    > 
    > scala>
    

    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...