Click above "Program IT Circle ", select "Stick to Top Official Account"
Come in at 8:50 every morning to have a look, that is the greatest support
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 are of great significance to the project structure. It is precisely where many IDEA beginners find it troublesome.
1.1 Why cancel the workspace?
Answer: Simply speaking, 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. Each sub-module can be related or not.
2. Current project configuration VS default configuration
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. New projects have to be reconfigured, which is obviously not in line with 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 the 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)
Specific 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 small 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 smart 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 but 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 small partners couldn't find the configuration of Tomcat at the beginning, but it's actually very simple. Tomcat or Jetty are deployment containers, so they will naturally think of Deployment, open the deployment configuration, and you can see the configuration of the application server.
Configure Tomcat method: File -> Settings -> Deployment -> Application Servers -> Tomcat Server
The specific configuration method is as follows:
IDEA essential skills
In order to improve development efficiency, we have carefully prepared the following tips for everyone with 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, the combination of 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.
Finally, if you want to know how SpringBoot implements hot deployment, please see the article below.
SpringBoot+IDEA Hot Deployment Tutorial: https://www.jianshu.com/p/f658fed35786
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
The default white background and small fonts 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 key 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 keys to be the same as those of 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
As shown below:
13. Open the Maven artifact (highly recommended!)
Specific steps: directly click on the Maven Project management plug-in on the right, remember to open the common toolbar first, see 8.3 for details.
As shown in the figure 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 for 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 to make reading source code more refreshing!
File -> Settings -> Editor -> General -> Code Folding -> Documentation comments Check.
If you want to quickly open all comments with one click, click the right mouse button 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 can answer you with certainty, you don’t need to delete it, just 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~
Punch in to give away books:Punch in for 30 days to give away books, the second phase of the event is here!
What book to send? Please click on the lower left cornerRead the original textView!
Sign-in method: long press the following QR code to participate in check-in↓↓↓↓↓
My knowledge planet, free to join for a limited time!
10 GIF animations let you understand concepts such as recursion and binary search
What is a red-black tree? Learn it in detail today.
The underlying data structure and algorithm of HashMap
Detailed explanation of the implementation mechanism of Spring AOP
Twelve pictures explain the data structure and object system of Redis in detail
Five minutes to thoroughly understand the consistent hashing algorithm
Why should we use AOP?
The underlying queue implementation principle of TCP/IP
Spring Boot integrates JWT to realize user authentication (with source code)
Spring Boot quickly integrates MyBatis (with source code)
Remember to pin/star this number,
Don't forget to sign in every day!
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/Favorite%20this%20IntelliJ%20IDEA%20usage%20skills.html
评论列表(196条)
测试