Introduction: IntelliJ IDEA

If IntelliJ IDEA is a modern intelligent development tool, Eclipse is a Stone Age thing. In fact, the author is also an explorer from Eclipse to IDEA. With the recent continuous development practice and debugging, I gradually realized the huge development convenience brought by this intelligent IDE. With the powerful plug-in function support, such as support for Git and Maven, it is almost impossible to stop. Finally, I had to be impressed by this amazing IDE. In order to let more partners around to participate in the decision to write this article, and share with you. (^_^)

IntelliJ IDEA 官网下载 – Ultimate:

Activation method: After installation → Select License → Enter:

Text: IntelliJ IDEA use tutorial

1. Comparison of core terms of IDEA VS Eclipse

** As can be seen from the following figure, ** The biggest change between the two is the change in the concept of workspace. In addition, in IDEA, Project and Module are two different concepts, which are of great significance to the Project structure, which is exactly what many IDEA beginners find troubling.

1.1 Why cancel the workspace?

A: ** Simply put, IDEA does not require a workspace, because every Project has a workspace!! ** For each IDEA Project, each sub-module can use a separate JDK and MAVEN. This adds a great deal of convenience to the refactoring of traditional projects into new ones, a diversity of flexibility that is missing from Eclipse because it has tied up the workspace in its initial use.

1.2 In addition, many novices will ask why the sub-project in IDEA is called Module?

A: In fact, it is the concept of modularity. As an aggregate Project or a common root directory, it is called a Project, and the following sub-projects are called modules, and each sub-module may be associated with or without any association.

2. Current project configuration VS default configuration

2.1 Why do I need the default configuration when I have the current project configuration?

** Since IDEA has no concept of workspace, each new Project needs to set up its own JDK and MAVEN configuration, which increases flexibility but requires reconfiguration for each new Project, which is obviously not what we expected. In this context, the Default configuration gives the current project configuration the Default option, and the problem is solved.

2.2 Initialization Procedure

Open Default Settings: top navigation bar -> File -> Other Settings -> Default Settings /ProjectStructs

Open the current configuration: top navigation bar -> File -> Settings/ProjectStructs

Figure:

If the current Project wants to override the default configuration, just set it in Settins/Project Structure.

Next, take a look at IDEA how to quickly build a Java development environment!

3. Global JDK (default configuration)

Detailed steps: Top toolbar File ->Other Settins -> Default Project Structure -> SDKs -> JDK

Example: Follow the steps below to set up the JDK directory and click OK to save.

PS: Similarly, the current Project can set the preferred JDK version for the Project and each module in Project Structure.

4. Global Maven (default)

For details, see File ->Other Settings -> Default Settings -> Build & Tools -> Maven on the top toolbar

Example: In theory, you only need to configure the Maven home directory. In practice, User Settins file is recommended.

PS: You are advised to configure the local repository in Settings for easy access. For example, D: mvnrepository

5. Version control Git/Svn (default)

The details are as follows: Top toolbar File ->Other Settings -> Default Settings -> Version Control -> Git

Example: IDEA integrates Git/Svn support by default. Directly set the execution program.

Some users complained that svN. exe could not be found. The solution is to reinstall the SVN and select Command Line Client Tools as the configuration item.

PS: Git plug-ins built into IDEA are often useful, especially for code that resolves conflicts. SourceTree is recommended for Git clients.

6. Automatic package guide and intelligent removal (default)

Detailed steps: Top toolbar File ->Other Settings -> Default Settings -> Auto Import

On the Internet to see a lot of people in question IDEA why can not optimize guide package and Eclipse can, so deliberately extracted to share with you IDEA how to optimize guide package.

**7. Tomcat Server (Current project configuration) **

Tomcat or Jetty are both containers for Deployment, so it naturally reminds you of Deployment. Open Deployment configuration, and you can see the configuration of the application server.

To configure Tomcat: File -> Settings -> Deployment -> Application Servers -> Tomcat Server

The specific configuration method is shown as follows:

IDEA essential skills

In order to improve the development efficiency, we prepare the following practical index five stars tips:

8. Automatic compilation

Detailed steps: Top toolbar File ->Other Settings -> Default Settings -> Auto Import

Note: When autocompile is enabled, Ctrl+Shift+F9 will create hot update effect.

Automatic compilation (Runtime)

Specific steps: hit Ctrl + Shift + Alt + / search into the Registry, and then double-click the Shift to find compiler. Automake. Allow. The when. App. Running, then to check.

9. Disable case sensitivity

Specific steps:

File | Settings | Editor | General | Code Completion Case | Sensitive Completion = None

By removing size sensitivity, the code’s automatic prompts will be more comprehensive and rich as it is written.

10. Adjust font types and sizes

The default white background and small fonts will affect your coding experience, so there is a quick configuration to adjust the code window. Open the configuration, search Font, and then Font can adjust the Font type, Size can adjust the Font Size, as shown in the picture:

11. Set the shortcut keys to be the same as Eclipse

Many people may not be used to IDEA shortcuts, so for convenience, we set them to be the same as Eclipse shortcuts.

To do this: File -> Settings -> Keymap -> Select Eclipse.

Those who have transferred from Eclipse can use it safely

12. Open the toolbar

To do this, select Toolbar & Tool Buttons from the top navigation bar – View ->

As shown below:

13. Open the Maven artifact (highly recommended!)

For details, click Maven Project management plug-in on the right and open the common toolbar first. See 8.3 for details.

If you are still struggling with the Update command in Eclipse, please try this plug-in. It will bring you more fun than ever!!

14. Essential keyboard shortcuts for lazy people

①. Press [middle mouse button] to quickly open the intelligent prompt, instead of Alt + Enter.

File->Settings-> Keymap-> Search Show Intention Actions -> Add shortcut key as middle mouse button.

②. Press [F2] to quickly modify the file name and say goodbye to the two-handed operation.

File->Settings-> Keymap-> Search Rename ->Set the shortcut key to F2.

③. Press [F3] to directly open the directory where the file is located and browse in one step.

File->Settings-> Keymap-> Search Show In Explorer -> set the shortcut key to F3.

(4). Press [Ctrl+ right] directly open the implementation of the class, convenient development and query.

File->Settings-> Keymap-> Search Implementation -> Add Mouse Shortcut set the Shortcut key to Ctrl+ right Mouse button.

15. People with severe OBSESSIVE compulsive disorder

**①. Cancel case sensitivity, let auto complete more complete! **

The File | Settings | Editor | General | Code Completion Case | Sensitive Completion = None.

**②. Automatically hide comments, so that the source code read more refreshing! **

File -> Settings -> Editor -> General -> Code Folding -> Documentation Comments check.

To quickly open all comments in one click, right-click Folding -> Expand Doc Comments.

Maven automatically downloads the source code package, say goodbye to decompile, directly on the source code comment!!

File | Settings | Build, Execution, Deployment | Build Tools | Maven | Importing

Check the Source for Automatically Download.

16. Question 10 answer

①. How to open a local project/existing project?

A: Click File -> Open to Open the project folder, pay attention to the basic configuration of JDK, Maven and so on.

②. How to delete the project project?

Coder (File-> Close Project) Coder (File-> Close Project) Coder (File-> Close Project) Example:

What? You still want to kill the whole catalog? Right-click Show In Explorer and delete the folder. If you need it in the future, what do you think?

How to open multiple Maven projects in a single window?

A: Create a new folder and throw the project into it. Use IDEA to open the folder.

④ How to add multiple modules for the current project?

A: Right click on the project -> New -> Module -> Usually choose Spring Initializr, as shown:

The new module

Multi-module engineering

Finally, that’s it. Leave your thoughts in the comments section. If today’s article gives you new inspiration and new understanding on the improvement of learning ability, please share it with more people.