How do I install Scala on Windows?

Scala on your Machine:

If you only use Scala on a machine in a computer lab, hopefully, everything will have been set up for you so that you can simply type the name of a command and it will run. To run Scala on your own machine you can follow the instructions below.

Scala Installation:

Scala requires Java® to run so if you do not have Java installed you should go to http://java.oracle.com and download then install the most recent version of the Java SE JDK. When you install Java, you can go with the default install locations. After you have Java installed you can install Scala. To download Scala go to scala.org.

Dealing with the PATH:

If you are using Scala on your own machine, it is possible that entering scala or scala.bat on the command line could produce a message telling you that the command or program scala could not be found. This happens because the location of the installed programs is not in your default PATH.

The PATH is a set of directories that are checked whenever you run a command. The first match that is found for any executable file in a directory in the PATH will be run. If none of the programs in the PATH matches what you entered, you get an error.

When you installed Scala, a lot of different stuff was put into the install directory.
That included a subdirectory called “bin” with different files in it for the different executables. If you are on a Windows machine, odds are that you installed the program in C:\Program Files (x86)\scala so the scala.bat file that you want to run is in C:\Program Files\scala\bin\scala.bat. You can type in that full command or you can add the bin directory to your PATH. To do this go to Control Panel, System and Security, Advanced System Settings, Environment Variables, and edit the path to add C:\Program Files\scala\bin to the path.