Scala configuration and installation tutorial in IDEA software (Spark computing environment construction)

The first step is to install Scala (plugin and SDK)

The plug-in is the configuration of IDEA software. With the plug-in, you can create Scala projects and classes in IDEA;
while the SDK is the configuration of the real Scala development environment tool. With the SDK, you can write Scala code and run Scala classes.

1. IDEA Scala plugin installation

Figure 1 IDEA start interface
Figure 2 plugins

In Figure 1, after clicking Configure, a drop-down box will pop up, and then click Plugins in the drop-down box, as shown in Figure 2.

Method one, online installation

In the Plugins window, click MarketPlace, enter Scala in the search box, and click Install. If Install becomes Installed, the installation is successful.

Method two, offline installation

First open the official website link: https://plugins.jetbrains.com/plugin/1347-scala/versions . Download the zip package of the Scala plugin (take version 2020.1.41 as an example), no need to decompress it after the download is complete .
Scala plugin compressed package file
Then click the settings icon on the right of Installed under Plugins, and select Install Plugin from Disk... in the pop-up drop-down box to enter the file selection interface, as shown in the figure below;





Install Plugin form Disk
Choose Plugin file

2. Scala SDK installation (take 2.13.3 version as an example)

Method one, installation package installation

Open the official website link: https://www.scala-lang.org/download/ , download the Scala SDK installation package msi at the bottom of the page
Insert picture description here
, double-click the downloaded msi installation package file, select the installation directory, and proceed with the step-by-step installation. After the installation is complete, the system will automatically prompt, click Finish.

Method 2: Decompress the compressed package

Open the official website link: https://www.scala-lang.org/download/ , download the compressed package zip of the Scala SDK at the bottom of the page and
Insert picture description here
Insert picture description here
unzip it to the directory you created.

After the Scala SDK is installed, refer to the setting of environment variables ( https://www.scalalang.org/download/install.html )

The third step is to create a new Scala project in IEDA

To create a Scala project in IntelliJ, please refer to the official website link: https://docs.scala-lang.org/getting-started/intellij-track/getting-started-with-scala-in-intellij.html .
Open the IDEA software and click Create New Project

select Scala in the left panel, select IDEA in the right panel:

then name the project HelloWorld, select the directory, select Scala SDK:

enter the project interface, right-click on the src New->Scala Class

in Create New Select Object in the Scala Class window, enter HelloClass as the class name

, write the code in the Hello Class class, and then right-click Run HelloClass.

Finally, the successful operation result is as shown in the following figure:

At this point, use IDEA to configure and install Scala and create a Scala project. ! !

Guess you like

Origin blog.csdn.net/jing_zhong/article/details/108050313