“This is the 23rd day of my participation in the November Gwen Challenge. See details of the event: The Last Gwen Challenge 2021”.

1. Intellij IDEA development environment construction

Recently, I am learning Scala. Besides writing Scala programs, I also need to create Maven projects and Jar packages. However, Eclipse does not use such aspects in this respect. Intellij IDEA now also provides community version for developers to use for free, so many original Eclipse users are gradually turning to IDEA. On the one hand, intelligent hints and shortcuts can improve development efficiency; on the other hand, its clean interface design and rich plug-in integration functions facilitate integrated development and use of programs. Here is the website to download address www.jetbrains.com/idea/downlo…

The installation process can go all the way to next, and don’t worry about too many plugin problems until the project is created. Here are some common Settings:

  1. Specify the JDK directory when creating a JAVA project for the first time
  2. Set font size and spacing:
  3. Font size and spacing for the console:
  4. Display line number:Uploading…Upload againcancel
  5. Display ToolBar and Tool Buttons under View, [setting]Right in the ToolBar:Uploading…Upload againcancel
  6. When you can’t modify, save as first, which is the design philosophy of Intellij

2. The scala configuration

There is no Scala plug-in in the default configuration of Intellij IDEA, which needs to be manually installed. Select Configure Plugins when Intellij IDEA runs for the first time, and then configure it on the main interface of the software. However, the test found that this setting method often fails to be configured due to network problems. Advice directly to plugins.jetbrains.com/plugin/1347… Go to plugins in the IDEA installation directory and start Intellij IDEA

After configuring Intellij IDEA 14.1.4, let’s look at how to create a Scala development environment:

1 File->New Project 

The following interface is obtained:

Select Scala, then next step:

On the right side of the Project SDK, click New to get:

Select JDK and the JDK installation directory in the dialog box that is displayed

On the right side of the Scala SDK, click Create to get the following interface:

You can choose the Scala built-in in Intellij IDEA or use the Scala installed by yourself. Click “Browse” in the figure above and select the Scala installation directory. After configuration, finish directly to obtain the following project directory

Go to File->Project Structure

In the SRC directory, right-click new fold and call it main. Right-click main, also new fold, call it Scala, and set it to Sources. XX is already defined as object XX

The overall project file has been created, as shown below: In the Scala source directory, use the direct name key, New -> Scala Class, select Object, and type the name :HelloWorld

Enter the following code:

1 object HelloWorld  {
2   def main(args: Array[String]) {
3     println("Hello World")
4   }
5 }
Copy the code

Click on the HelloWorld.scala file, right click or run the program directly CTR + Shift +F10

Intellij IDEA Common shortcut keys

shortcuts Use to describe
Ctrl+Shift+A Lookup operations by name, such as lookup create scala class operations
Alt+F1 The view switches
Ctrl+Tab Tool window, code file being edited switch
Alt+Home Display navigation bar
Ctrl+J Insert a code template, such as the main method
Ctrl+Alt+J Wrap the selected code in a code template
F4 The project configuration window is displayed
Ctrl+Slash Comment the code //
Ctrl+Shift+Slash Comment code /**/
Ctrl+N/Ctrl+Shift+N Enter a name to query a class or file
Ctrl+D Copy the selected code
Ctrl+W / Ctrl+Shift+W Make code choices intelligently
Ctrl+F Text content lookup in the current file
Shift+Shift search everywhere
Ctrl+Shift+F7 Highlights how the previous method or symbol is used in the current file
Ctrl+Space Code autoprompt
Ctrl+Shift+Enter Statement completion
Alt+enter Automatic code correction

Scala configuration intellij IDEA15.0.3 environment and Hello World!