Intellij IDEA graphic tutorials from entry to addiction

1. Comparative IDEA VS Eclipse core term

Seen from the following figure: the two biggest change is that changes in work space concept, and in which IDEA, Project and Module as two different concepts, the structure of the project is of great significance, and this is precisely what many IDEA beginners feel troubled place.

Eclipse IDEA
WorkSpace Project
Project Moudel
Facet Facet
Library Library
JRE SDK
classpath variable path variable

1.1 Why you want to cancel work space?

In simple terms, IDEA does not need to set up work space, because each will have a Project workspace! ! For each of the IDEA project (Project), each of its sub-modules (Module) can be used independent of the JDK and MAVEN configuration. This traditional reconstruction projects towards new projects added great convenience, the absence of such a wide range of adaptability is the Eclipse, because Eclipse began during the initial use has been tied to a dead workspace.

1.2 In addition, many novice will ask why IDEA inside the sub-projects will be called Module?

In fact, the concept of modularity, as a polymerization engineering Yihuo common root directory, it calls Project, and the following sub-project called modules, can be associated, also no association between each sub-module.

2. Current project configuration VS default configuration

2.1 Why have a current project configuration, you need the default configuration?

Because IDEA is no concept of workspace, so each new project (Project) needs to set up their own MAVEN JDK and other related configuration, although this increases flexibility, but have to be reconfigured for each new project, which clearly not in line with our expectations. In this context, the default configuration given the current project configuration provides the Default option, problems will be solved.

Supplementary: IDEA order to clarify the concept of the new project configuration, after the official version 2018.2 has been officially "Default Settings" Change the name "Default Settings / ProjectStructs", or "default configuration" means "new project configuration."

2.2 initialization step

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

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

sample graph:

If you want to override the default configuration of the current project, directly to the Settins / Project Structure.

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

3. Global JDK (default configuration)

Specific steps: the top toolbar File -> Other Settins -> Default Project Structure -> SDKs -> JDK

Example: The following figure is provided JDK directory step, and click OK to save.

Note: SDKs stands for Software Development Kit, JDK because IDEA supports a variety of development kits.

Similarly, the current project can set the JDK version love for each module in the project and Project Structure.

4. Global Maven (the default configuration)

Specific steps: the top toolbar File -> Other Settings -> Default Settings -> Build & Tools -> Maven

Example: in theory, as long as the home directory can be configured with Maven, the actual development of recommended User Settins file.

Here reminder, address Apache Maven local repository is automatically generated, typically, it is recommended in the user directory of the C drive in the actual development of the local warehouse address you specify, to avoid cleaning up third-party security tools due to reinstall the system or while data loss. Maven configuration is very simple, delete the comment after a glance. (Note: Maven are not familiar with, you can reply "video maven" In our Java Concert public number, get maven video tutorial) Figure:

Open Maven artifact

Eclipse still use the Update command struggling children's shoes, please rushed to try Maven plug-IDEA offer the convenience of its operation will bring you an unprecedented feeling happy! !

Specific steps: the right side of the toolbar Maven -> click to expand a project or modules -> fast execution of Maven command.

The version control Git / Svn (the default configuration)

Specific steps: the top toolbar File -> Other Settings -> Default Settings -> Version Control -> Git

Instructions: IDEA default integrated support for Git / Svn directly set the execution procedure, the right of Test prompts can be successful.

Feedback question: There are some small partner, said feedback IDEA can not find svn.exe, solution: reinstall SVN, configuration item re-select the command line client tools can be.

IDEA built-in Git plugin gray often useful, especially to solve the conflict of the code. In addition Git client recommended SourceTree.

6. The automatic guided smart packages and removal (the default configuration)

Specific steps: the top toolbar File -> Other Settings -> Default Settings -> Auto Import

Instructions: In line to see a lot of people question why can not optimize the IDEA and Eclipse can lead package, this is not a low-end black thing, so he drawn to share with you how to optimize the IDEA guide package.

7. Tomcat Server (the current project configuration)

Many small partners can not find the beginning Tomcat configuration is actually very simple, container Tomcat or Jetty these are deployed, it will naturally think of Deployment, open the deployment configuration, you can see the configuration of the application server.

配置Tomcat方法:File -> Settings -> Deployment -> Application Servers -> Tomcat Server

For configuration, as shown below:

IDEA skills necessary small

In order to improve development efficiency, the main line and close the following utility index of five stars for everyone tips

8. automatic compilation

Specific steps: the top toolbar File -> Other Settings -> Default Settings -> Auto Import

Description: After enable automatic compilation, combined with Ctrl + Shift F9 will have the effect of heat update +.

Specific steps: Tap Ctrl + Shift + Alt + / Shift and then double-click the search into the Registry, find compiler.automake.allow.when.app.running, then check on.

9. Cancel case sensitive

Specific steps:

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

Cancel the size sensitive, in preparation of the code, the code will automatically prompt a more comprehensive and rich.

10. Adjust the font type and size

The default white background and small fonts affect your coding experience, specially configured to provide a quick adjustment of the code window here. Open configuration, Font search, and then can adjust the font type Font, Size can adjust the font size, as shown:

11. shortcuts to like Eclipse

Many people may not be accustomed to shortcuts IDEA, in order to facilitate, where we will set shortcuts like Eclipse.

Specific steps: File -> Settings -> Keymap -> select Eclipse.

Eclipse from a small partner in turn can be assured

12. Open the Standard toolbar

Specific steps: the top navigation bar - View -> Check the Toolbar & Tool Buttons

As shown below:

13. lazy essential shortcuts

A. [by] the middle mouse button to quickly open smart tips, to replace alt + enter.

File-> Settings-> Keymap-> Search Show Intention Actions -> Add Shortcut to the middle mouse button.

B. Press [F2] to quickly change the file name, bid farewell to two-handed operation.

File-> Settings-> Keymap-> Search Rename -> shortcut key is set to F2.

C. Press [F3] to directly open the file directory, browse in one step.

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

D. press Ctrl + [right mouse button] to open direct implementation class, facilitate the development of inquiry.

File-> Settings-> Keymap-> Search implementation-> Add Mouse Shortcut shortcut key is set to Ctrl + right mouse button.

14. Severe OCD

A. cancel case-sensitive, so that automatically prompts a more complete!

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

B. hidden configuration directory development tools such as .idea; .iml

File | Settings | File Types | In the end, add .idea; .iml

C. retracted the comment, so read the source code is more refreshing!

File -> Settings -> Editor -> General -> Code Folding -> Documentation comments 勾选。

How quickly would like a key to open all comments, click the right mouse button, select Folding -> Expand Doc comments.

15. IDEA Q & A

(1) How to open a local engineering project / existing?

A: Click on File -> Open to open the project folder can pay attention to configure the JDK, Maven and other basic configurations.

How (2) .IDEA delete the project?

A: ask this question Coder really cute ah ha ha, very sure of your answer, do not need to delete,

Click File-> Close Project to quickly close the current project;

Example:

what? You still want to get rid of an entire directory? It is also to wide, right-Show In Explorer, delete the folder. But I still recommend direct Close to turn off the thousand million, in case after the lingua franca of it, you say?

(3) How to open multiple windows in a single Maven project ah?

A: just create a new folder, and then are thrown to the project, using IDEA open this folder.

(4) How to add multiple modules ah for the current project?

A: Right in front of the project -> select New -> Module -> usually choose Spring Initializr, as shown:

-- END --

Guess you like

Origin www.cnblogs.com/MrZhangxd/p/11563675.html