How to install Scala in Windows?

Prerequisite: Introduction to Scala
 
Before, we start with the process of Installing Scala on our System, we must have first-hand knowledge of What the Scala Language is and what it actually does? Scala is a general-purpose, high-level, multi-paradigm programming language. It is a pure object-oriented programming language which also provides the support to the functional programming approach. There is no concept of primitive data as everything is an object in Scala. It is designed to express the general programming patterns in a refined, succinct, and type-safe way. Scala programs can convert to bytecodes and can run on the JVM(Java Virtual Machine). Scala stands for Scalable language. It also provides the Javascript runtimes. Scala is highly influenced by Java and some other programming langauges like Lisp, Haskell, Pizza etc.
Scala is a very compatible language and thus can very easily be installed into the Windows. The most basic requirement is that we must have Java 1.8 or a greater version installed on our computer.

Verifying Java Packages:
The first thing we need to have is a Java Software Development Kit(SDK) installed on the computer. We need to verify this SDK packages and if not installed then install them. Just go to the Command line(For Windows, search for cmd in the Run dialog( + R).
Now run the following command:

java -version 

Once this command is executed the output will show the java version and the output will be as follows:
Java-version-check-scala
In case we are not having the SDK installed then download the latest version according to the computer requirements from oracle.com and just proceed with the installation.

Downloading and Installing Scala:

Downloading Scala:
Before starting with the installation process, you need to download it. For that, all versions of Scala for Windows are available on scala-lang.org
download-scala-from-here
Download the Scala and follow the further instructions for the installation of Scala.

Beginning with the Installation:

  • Getting Started:
  • Getting done with the User’s License Agreement:
  • Move on to Installing
  • Installation Process:
  • Finished Installation:

After completing the installation process, any IDE or text editor can be used to write Scala Codes and Run them on the IDE or the Command prompt with the use of command:

scalac file_name.Scala
scala class_name

Here’s a sample Program to begin with the use of Scala Programming:
Let’s consider a simple Hello World Program.

filter_none

edit
close

play_arrow

link
brightness_4
code

// Scala program to print Hello World!  
object Geeks  
    // Main Method  
    def main(args: Array[String])  
    
        // prints Hello World 
        println("Hello World!")  
    

chevron_right


Output:
Hello-World-Scala-Windows
My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.