Scala downloading and installing on Windows PC is quite a simple task but still some people find it difficult. Let's make that problem easy - So stay tuned with this article because today we will give you a step by step guide with which you will be able to install Scala on your Windows PC but before that let's take a overview of Scala programming language.
What is Scala?
Scala is a modern high level programming language which runs on Java Virtual Machine (JVM). Scala programming language is developed as an open source programming language which means that anyone can download and use it for free from its official website. And Scala programming language was licensed under Apache 2.0 license. Scala programming language was designed by Martin Odersky in the year 2001 and developed at École Polytechnique Fédérale de Lausanne which is located in Lausanne, Switzerland in 2003. Scala programming language was publically released on 20 January 2004. Scala programming language is a statically typed programming language which is mainly used to develop web applications. Scala programming language is compatible with Java programming language and the syntax of Scala programming language are quite similar to the syntax of C programming language.
Now let's discuss about how to download and install Scala in Windows PC.
How to download and install Scala on Windows 10
Here, we will discuss the step by step guide to download and install Scala on Windows 10 PC;
• Check if java environment is already installed on your computer or not
Before downloading Scala, it is important to check whether the Java Runtime Environment (JRE) is already installed on your computer because you cannot compile and run Scala code without the Java JDK or JRE. To Check this - just go to command line and type;
And press "Enter". If you see the version of java in it, then it means java is installed in your pc.
And if it doesn't come then it means that java is not installed in your PC - In that case, first you need to download and install the Java Runtime Environment (JRE).
• Download Scala SBT Installer file
Now, it's time to download the Scala SBT file. For that, go to latest Scala download for Windows. Here you will see both scala 2 and scala 3 options, out of which you have to choose one. If you have already started with old code base then click on scala 2 download and if you are new scala user then you can start with scala 3 - In my case, I'm new in Scala development so, i will go with "Scala 3".
Now there are two ways to download scala either through SBT or through coursier. In this tutorial we will only teach you how to install scala via SBT. We will learn about installing scala by coursier in the next tutorial - So for now, just click on "Download SBT".
Now, you have to choose the package of scala that you want to install on Windows 10 - According to me, click on first package and download it.
• Install Scala SBT
Now, it's time for scala installation on Windows. For this, go to downloads folder then click on sbt-x.x.x.msi file and open it.
After clicking on this, you will reach on scala Setup wizard - just click on "Next" to start setup for installation.
Now, read the user end license agreement carefully!! - after reading this, tick out "I accept" option and click on "Next" to continue.
Good to say that Scala is ready to install on your Windows 10 operating system - Now, just click on "Install'' to begin installation.
Wait for a while until scala is successfully installed. After scala is installed - just click on "Finish" to exit the setup wizard.
• Set path for Scala in Environment variable (If not Present)
If the path is automatically generated on the environment variable after installing Scala, then it's fine. Otherwise you have to manually setup the path on the environment variable. To create new path on environment variables - go to This PC > (C:) > Program files (x86) > sbt > bin then copy this destination path by pressing Ctrl+c key.
Now, go to advance system settings and click on environment variable.
Here, select the "path" option and click on "Edit".
Now, search for C:\program files(x86)\sbt\bin - If this path is already included then skip this step. And if this path is not showing then you have to enter it manually. It is quite simple - just click on new then paste the bin folder destination location and click on "ok" to save settings. Its done!!
• Create a new folder & download necessary files related to SBT installation
In this step, we will create new folder and download necessary files related to scala by using command line. To perform this, let's go to command prompt.
-Now to create new folder just type in command line;
And press "Enter" key. Now, go to (C:) > users > your user name - here you can see scala_samples directory is created.
Now, just click on Scala_samples then copy the destination location and come back to command line.
-Now, just type cd and paste path in command line;
-Now, you have to create new folder inside scala_sample directory. For this, just type in command line;
And press "Enter". Now you will see, new folder inside scala_samples directory has been created successfully.
Now, type this in command line;
-Now to download additional files just type this in command line;
And press "Enter". Now you will see, Scala additional files and directories are starting to download. Wait for some time till this files are completely downloaded.
Now, the installation for sbt is over and now you can start coding in Scala.
Above we discussed the tutorial for Scala downloading and installing on Windows PC. Scala is a modern high level programming language which runs on Java Virtual Machine (JVM). Scala programming language is developed as an open source programming language which means that anyone can download and use it for free from its official website. And Scala programming language was licensed under Apache 2.0 license. Scala programming language was designed by Martin Odersky in the year 2001 and developed at École Polytechnique Fédérale de Lausanne which is located in Lausanne, Switzerland in 2003. Here, we have discussed the step by step guide to download and install Scala on Windows 10 PC and by following these steps anyone can easily download and install Scala programming language on windows 10 PC. I hope this information is helpful to you all.