Scala Installation Tutorial (2023, May)

1. Preparations before downloading Scala.

1. Since Scala runs on the JVM (JAVA virtual machine) platform, please make sure that JDK is installed on the computer before installing scala. If not, you can follow the JDK1.8 installation tutorial below to download jdk:

Link: JDK1.8 installation tutorial

2. Before downloading Scala, ensure the compatibility between the Scala version and the JDK version, otherwise there will be problems later. The link below can directly view the official version compatibility table:

Link: https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html

Two, Scala download

1. Enter Scala official website

Official website address: https://www.scala-lang.org/

2. Click [ALL RELEASES] to view all versions of Scala.

 3. Because I downloaded the JDK1.8 version (also known as Java8) , which meets the minimum version requirement of Scala2.13.0 version, so I choose to download the Scala2.13.10 version and click [Scala2.13.10]. (Note: Some people may doubt that the Scala3.0 version is also compatible with jdk1.8, why not download the Scala3.0 version? Because the current version after 3.0 can only be downloaded on GitHub, and then the network speed when entering GitHub is too slow , so I'll show you guys later.)

 4. Scroll down to find the "Other resources" column, and click [Scala-2.13.10.msi] to download.

.msi: Refers to the program installation file, you can install Scala yourself
.zip: It refers to the green version, that is, the compressed package, which is the installed Scala, and can be decompressed directly without installation.

5. Downloading

3. Scala installation

1. After downloading, double-click to open it may pop up a prompt that this file has a virus, you can ignore it and click [OK].

 2. Click 【Run anyway】.

 3. Then a welcome to use Scala window will pop up, click [Next] to go to the next step.

 4. Check "I accept the terms in the License Agreement" to accept the license agreement, and then click [Next].

 5. Modify the default installation path on the C drive, click [Browse] to change the location to the D drive, create a new file on the D drive and name it "Scala" (the name can be chosen at will), then select this folder and click OK alright.

 6. After changing the installation address, click [Next].

7. Click [Install] to install Scala.

 8. Click [Finish] to complete the installation. (At this point, Scala has been installed, you can directly see the fourth point to configure environment variables)

 9. If you want to download the Scala3.0 version, click [Scala3.0.2].

 10. Click "github" to jump.

 11. Then directly click [scala3-3.02.zip] to download the Scala compressed package.

 Fourth, configure environment variables

1. If you installed Scala through a program, you don’t need to configure environment variables. You can directly enter the scala command to enter Scala, because after scala is installed, the path of Scala’s bin directory will be automatically added to the system path variable. If you decompressed scala in the form of a compressed package, you need to configure the environment variables yourself. First, right-click on "This Computer" on the computer desktop, select "Properties" → "Advanced System Settings" → "Environment Variables ", click [New].

 2. Add variable name: SCALA_HOME

Add variable value: Scala installation path.

After adding, click [OK].

 3. Find "path" in "System Variables", double-click to edit it, and click [New].

 4. After clicking New, add variable value: %SCALA_HOME%\bin

After adding all windows, click [OK] to close and save the environment variable configuration.

 5. Test

1. Win+R to open the run window, enter "cmd" and click [OK] to enter the command prompt.

2. Enter the command scala -version to view the version information of scala.

scala -version

 3. Entering the scala command will enter the scala command mode. At this point, your scala will be installed and configured.

Guess you like

Origin blog.csdn.net/hh2093531258/article/details/130752766