Author: yizhiwazi
https://www.jianshu.com/p/9c65b7613c30
Preface: IntelliJ IDEA
If IntelliJ IDEA is a modern intelligent development tool, Eclipse can be called something from the Stone Age. In fact, the author is also an explorer who transferred from Eclipse to IDEA. With the recent continuous development practice and debugging, I gradually realized the great development convenience brought by this smart IDE. With the support of powerful plug-in functions, such as Git and Maven The support is simply unstoppable, and various code prompts, including JS, are at your fingertips, and you have to be convinced by this magical IDE in the end. In order to let more friends around me participate, I decided to write this article and share it with you. (*^_^*)
IntelliJ IDEA Official Website Download - Ultimate Ultimate Edition:
https://www.jetbrains.com/idea/download/#section=windows
Activation method: After the installation is complete → select License → enter: http://intellij.mandroid.cn
Text: IntelliJ IDEA tutorial
1. IDEA VS Eclipse Core Terms Comparison
It can be seen from the figure below: The biggest change between the two lies in the change of the concept of workspace, and in IDEA, Project and Module are two different concepts, which affect the project structure It is important, and this is exactly what many IDEA beginners find troubled.
1.1 Why cancel the workspace?
Answer: In short, IDEA does not need to set up a workspace, because each Project has a workspace! ! For each IDEA project (Project), each of its sub-modules (Module) can use independent JDK and MAVEN. This adds great convenience to the refactoring of traditional projects towards new projects. This kind of diversified flexibility is exactly what Eclipse lacks, because Eclipse has tied up the workspace when it is first used.
1.2 In addition, many novices will ask, why is the sub-project in IDEA called Module?
Answer: In fact, it is the concept of modularization. As an aggregation project or a common root directory, it is called Project, and the sub-projects below are called modules, and each sub-module can be associated. There can also be no association.
2. Current project configuration VS default configuration
span>
2.1 Why do we need the default configuration when we have the current project configuration?
Answer: Because IDEA has no concept of workspace, each new project (Project) needs to set up its own JDK and MAVEN related configurations, which improves flexibility, but But it has to be reconfigured for each new project, which obviously does not meet our expectations. In this context, the default configuration provides the Default option for the current project configuration, and the problem is naturally solved.
2.2 Initialization steps
Open the default configuration: top navigation bar -> File -> Other Settings -> Default Settings /ProjectStructs
Open the current configuration: top navigation bar -> File -> Settings / ProjectStructs
Example image:
If the current project wants to override the default configuration, just set it directly in Settins/Project Structure.
Next, let’s take a look at how IDEA quickly builds a Java development environment! !
3. Global JDK (default configuration)
Specific steps: top toolbar File ->Other Settins -> Default Project Structure -> SDKs -> JDK
Example: Set the JDK directory according to the steps in the figure below, and finally click OK to save.
PS: Similarly, the current project can set the favorite JDK version for the project and each module in Project Structure.
4. Global Maven (default configuration)
Specific steps: top toolbar File ->Other Settings -> Default Settings -> Build & Tools -> Maven
Example: In theory, as long as the Maven home directory is configured, it is recommended to use User Settins file for actual development.
PS: For easy reference, it is recommended to configure the local warehouse in Settings. For example D:\mvnrepository
5. Version control Git/Svn (default configuration)
Concrete steps : Top toolbar File ->Other Settings -> Default Settings -> Version Control -> Git
Example: IDEA integrates support for Git/Svn by default. Just set the execution program directly, and the Test on the right will prompt success.
Some partners reported that svn.exe could not be found. The solution: reinstall SVN, and re-select command line client tools for the configuration item.
PS: IDEA's built-in Git plugin is very easy to use, especially for resolving conflicting code. In addition, the Git client recommends SourceTree.
6. Automatic package import and intelligent removal (default configuration)
Specific steps: Top toolbar File ->Other Settings -> Default Settings -> Auto Import
Explanation: On the Internet, I saw a lot of people asking why IDEA can’t optimize the import package while Eclipse can,so I deliberately took it out to share with you How IDEA optimizes the import package.
7. Tomcat Server (current project configuration)
Many friends couldn’t find the configuration of Tomcat at the beginning, but it’s actually very simple. Tomcat or Jetty are all deployment containers, so they will naturally think of Deployment, open the deployment configuration, and you can see the configuration of the application server .
Tomcat configuration method: File -> Settings -> Deployment -> Application Servers -> Tomcat Server
The specific configuration method, as shown in the figure below:
IDEA essential skills
In order to improve development efficiency, considerate for everyone Prepare the following tips for a five-star practical index:
8. Automatic compilation
Specific steps: top toolbar File -> Other Settings -> Default Settings -> Auto Import
Note: After automatic compilation is turned on, combined with Ctrl+Shift+F9 will have a hot update effect.
Automatic compilation (Runtime)
Specific steps: Press Ctrl + Shift + Alt + / Then double-click Shift to search and enter Registry, find compiler.automake.allow.when.app.running , and check it.
9. Cancel case sensitivity
Specific steps:
File | Settings | Editor | General | Code Completion Case | Sensitive Completion = None
Cancel size sensitivity, when writing code, the automatic code prompt will be more comprehensive and rich.
10. Adjust font type and font size
span>
The default white background and small font will affect your coding experience, here is a quick configuration to adjust the code window. Open the configuration, search for Font, and then Font can adjust the font type, and Size can adjust the font size, as shown in the figure:
11. Set the shortcut keys to be the same as Eclipse
Many people may not be used to the shortcut keys of IDEA , for convenience, here we set the shortcut key to be the same as Eclipse.
Specific steps: File -> Settings -> Keymap - > Select Eclipse .
Partners who have transferred from Eclipse can use it with confidence
12. Open the common toolbar
Specific steps: top navigation bar - View -> check Toolbar & Tool Buttons
Shown below:
13. Open the Maven artifact (strongly recommended!)
Specific steps: Click the Maven Project management plug-in directly on the right side, remember to open the common toolbar first, see 8.3 for details.
As shown in the picture below: Children's shoes who are still struggling with the Update command in Eclipse, please try this plug-in quickly, it will bring you unprecedented pleasure! !
14. Necessary shortcut keys for lazy people
①. Press the [middle mouse button] to quickly open the smart prompt, instead of alt+enter.
File->Settings-> Keymap-> Search Show Intention Actions -> Add a shortcut key as the middle mouse button.
②. Press [F2] to quickly modify the file name, saying goodbye to 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.
④. Press【Ctrl+Right】to directly open the implementation class, which is convenient for development and query.
File->Settings-> Keymap-> Search implementation-> Add Mouse Shortcut Set the shortcut key to Ctrl+right mouse button.
15. Patients with severe obsessive-compulsive disorder
①. Cancel the case sensitivity, so that the auto-completion is more complete!
File | Settings | Editor | General | Code Completion Case | Sensitive Completion = None.
②. Automatically hide comments, making source code reading more refreshing!
File -> Settings -> Editor -> General -> Code Folding -> Documentation comments Check.
If you want to quickly open all comments with one click, right-click and select Folding -> Expand Doc comments.
③. Maven automatically downloads the source code package, bid farewell to decompilation, and directly upload the source code comment! !
File | Settings | Build, Execution, Deployment | Build Tools | Maven |
Check the Source of Automatically Download.
16. IDEA ten questions and ten answers
①. How to open a local project/existing project?
Answer: Click File -> Open to open the project folder, pay attention to configure the basic configuration such as JDK and Maven first.
②. How does IDEA delete the project project?
Answer: The Coder who asked this question is really cute. Haha, I will answer you with certainty. You don’t need to delete it. Click File-> Close Project to quickly close the current project ; Example:
What? Do you still want to kill the entire directory? That's okay, just right-click Show In Explorer and delete the folder. However, the author suggests that it is better to close it directly, in case it will be used in the future, what do you think?
③. How to open multiple Maven projects in a single window?
Answer: Create a new folder casually, then throw all the projects into it, and use IDEA to open this folder.
④. How to add multiple modules to the current project?
Answer: Right click on the project -> select New -> Module -> Usually choose Spring Initializr, as shown in the figure:
New module
Multi-module project
END
The blogger also has an excellent technical exchange group, many technical masters, CTO, the activity rate is more than 80%. More than 90% of the questions are answered. After adding a blogger friend, reply [Add group], and then answer technical questions, and only those who answer correctly can enter. Other bloggers and advertisers do not disturb enter the group introduction, Of course there will be some learning resources, in the group Direct reply to resource introduction
Recommended reading
Ali's open source distributed transaction framework!
Data Structure + Algorithm (Part 03) KO! Big O - Time Complexity
Algorithm + Data Structure (Chapter 02) Playing Minesweeper is an Optimization Algorithm
Algorithm + Data Structure (Chapter 01 ) Step down from the altar! Algorithm
【Interview Questions】Microsoft Interview Questions
Run! HashMap is worth reading!
How to design an excellent API (1)
How to design an excellent API( Two)
How to design an excellent API (three)
Isn't it great! Share it, guys!
Articles are uploaded by users and are for non-commercial browsing only. Posted by: Lomu, please indicate the source: https://www.daogebangong.com/en/articles/detail/A%20complete%20collection%20of%20IntelliJ%20IDEA%20skills%20speed%20collection.html
评论列表(196条)
测试