Download, install and configure idea and build Maven basic environment

Time:2021-2-24

Introduction to idea

summary

The full name of idea is IntelliJ, which is an integrated development tool launched by JetBrains company. It is a leader in java development tools. Based on this development tool, we can quickly develop our Java related projects. Compared with other development tools, idea provides more powerful prompt function, comprehensive shortcut key operation, template code and rapid resource integration.

Download and install

preparation

  • Hardware requirements

    1) Memory 8g or more
    2) If the free space of hard disk is more than 5GB, it is better to have a solid state hard disk.

  • Software requirements

    1)Microsoft Windows 8 or later
    2)macOS 10.13 or later
    3)Any Linux distribution
    4)Set Up and Config JDK1.8

Download idea tools

The download address of idea official website is as follows:

https://www.jetbrains.com/idea/

Based on different operating systems, you can choose ideas under different platforms, for example:
Download, install and configure idea and build Maven basic environment

Note: as for the community version (free version with limited functions) / Commercial Version (trial version), it’s up to you.

Idea tools installation

After downloading idea, it needs to be installed and used. If it’s just a downloaded decompressed version, you can copy it to a non Chinese directory, and then decompress it directly for application. If you download the executable program (such as. EXE file under Windows platform), you can directly start the executable program, and then follow the prompts to install step by step.

The official help documents of idea are as follows:

https://www.jetbrains.com/help/idea/discover-intellij-idea.html

Idea tools start

Find the root directory of the extracted or installed idea, and then enter the bin directory to find it idea.bat Or the idea64.exe file, and then directly double-click to start. The first start welcome interface is shown as follows:

Download, install and configure idea and build Maven basic environment

In the process of rendering the first interface, the bottom layer of idea is actually initializing. If it is the first time to start, you will enter the second interface after a while, for example:

Download, install and configure idea and build Maven basic environment

In the second interface, we first select create new project, and then enter the create project interface. Here, we first select create empty project, as shown in the figure

Download, install and configure idea and build Maven basic environment

After selecting the empty project, click next to enter the design of the project, as shown in the figure:

Download, install and configure idea and build Maven basic environment

In the figure above, click Finish to complete the creation of the project and enter the project work window of idea, as shown in the figure below:

Download, install and configure idea and build Maven basic environment

Basic configuration of idea

Appearance theme configuration

Download, install and configure idea and build Maven basic environment

Keymap configuration

Download, install and configure idea and build Maven basic environment

Editor configuration

General configuration

Scroll wheel to change the font size configuration, as shown in the figure:
Download, install and configure idea and build Maven basic environment
Package import configuration, as shown in the figure:
Download, install and configure idea and build Maven basic environment
Line number and method separator configuration, as shown in the figure:
Download, install and configure idea and build Maven basic environment
Code prompt configuration, as shown in the figure:
Download, install and configure idea and build Maven basic environment
Code completion configuration, as shown in the figure:
Download, install and configure idea and build Maven basic environment

Font configuration

The font configuration in the code editing area is shown in the figure
Download, install and configure idea and build Maven basic environment
Console font configuration, as shown in the figure:
Download, install and configure idea and build Maven basic environment

Color configuration

The annotation color configuration in the code is shown in the figure
Download, install and configure idea and build Maven basic environment

File encoding configuration

Download, install and configure idea and build Maven basic environment

Build execution configuration

Compiler (compiler configuration)

Automatic compilation configuration (optional). If it is selected, it may be slow, as shown in the figure:
Download, install and configure idea and build Maven basic environment

Maven configuration in build tools

Maven initialization configuration (if there are already configured ones, you can use them)

Find the conf directory under the Maven root directory on your disk, and open the settings.xml File, and then configure as follows:

  • Configure the Maven local library (where the resources downloaded from the Maven remote server are stored)
<localRepository>${user.home}/.m5/repository</localRepository>
  • Configure Maven private service (configure to the inside of mirrors tag).
 <mirror>
    <id>aliyun</id>
    <name>aliyun for maven</name>
    <mirrorOf>*</mirrorOf>
    <url>https://maven.aliyun.com/repository/public</url>
   </mirror>
  • Configure the profile in Maven (in the profiles tab), and set the JDK compile and run version.
 <profile>
   <id>jdk-1.8</id>
   <activation>
    <activeByDefault>true</activeByDefault>
      <jdk>1.8</jdk>
   </activation>
   <properties>
       <maven.compiler.source>1.8</maven.compiler.source>
       <maven.compiler.target>1.8</maven.compiler.target>
       <maven.compiler.compilerVersion>1.8
       </maven.compiler.compilerVersion>
   </properties>
 </profile>

Integrating Maven configuration in idea

Find the build tools / Maven option and integrate the local Maven configuration in idea. As shown in the figure:

Download, install and configure idea and build Maven basic environment

Summary

This section mainly gives a brief introduction to idea development tools, and then makes a preliminary configuration based on our subsequent applications. Based on this configuration, we can better carry out project creation and testing.

intellij-idea