IMPORTANT: you must also have installed Java, the runtime version 1.6 or newer. Java must be accessible via the PATH variable for your account. (See below to learn how to set PATH.)
Try your implementation by using Notepad to make a file named Hello.scala (please, not Hello.scala.txt) and place within the file the single line,
println("hello")Then, open a command window and type scala Hello.scala. You should see hello print in the window. (If you do not and see instead, 'scala' is not recognized as a command or you see 'java' not recognized as a command, then you must manually set the PATH variable on your computer. See below.)
Repeat until happy: - use text editor to edit your program, s.scala - within the command window, cd to the folder where s.scala lives and type scala s.scala and watch what happensYou can also compile Scala programs and run them later; see the other reference materials.
If you have no idea where Scala was installed on your computer, you must search for it:
Now, you must do the same steps to locate the path to java.exe. Let's say you found it at C:\Program Files (x86)\Java\jdk1.6.0_20\bin.
To use Scala within a command window, do this: Open a new command window and type the set path command:
set path=C:\Program Files (x86)\scala\bin;C:\Program Files (x86)\Java\jdk1.6.0_20\binThis tells the command window to search the indicated paths for Scala and Java.
Now, type
pathYou should see PATH=C:\Program Files (x86)\scala\bin;C:\Program Files (x86)\Java\jdk1.6.0_20\bin, confirming you have set correctly the lookup path. Now type
scalaYou should see the start-up message for the Scala interpreter. You can do your work in this command window. Now, exit the interpreter. (Type :quit)
It is a annoying to set the path every time you open a command window, so you should reset permanently the value of the Windows OS PATH variable so that Windows knows once and for all the paths to Scala and Java. Here is what you must do on Windows 7 to reset the PATH variable:
;C:\Program Files (x86)\scala\bin;C:\Program Files (x86)\Java\jdk1.6.0_20\bin
pathRead carefully the printed path and confirm that you typed the paths correctly for Scala and Java. Now, whenever you open a new command window and type scala, and path is already known by Windows 7, and it finds and runs the program.