The resource list

  1. Official website: www.jetbrains.com/idea/
  2. Teaching video website: www.jetbrains.com/idea/docume…

Introduction to the

IDEA, short for IntelliJ IDEA, is an integrated environment for Java programming language development. IntelliJ is recognized as one of the best Java development tools in the industry, especially in intelligent code assistant, automatic prompt code, refactoring, J2EE support, various version tools (git, SVN, etc.), JUnit, CVS integration, code analysis, innovative GUI design and other aspects of the function can be said to be extraordinary. IDEA is the product of JetBrains, a company based in Prague, the Capital of the Czech Republic, which is dominated by rigorous Eastern European programmers. Its flagship version also supports HTML, CSS, PHP, MySQL, Python, and more. The free version only supports a few languages such as Python.

Installation and cracking

Download address: www.jetbrains.com/idea/downlo…

Idea provides Windows, macOS, and Linux operating systems. Each operating system provides Ultimate and Community. The paid version contains all functions, and the Community version contains some functions. The download and installation process is similar to that of most software and will not be described here. It is worth mentioning that the paid version needs to purchase the registration code, which costs $499 per year, which is not cheap. Therefore, this department records the cracking methods of netizens, and if you have the ability to advocate and support the legitimate version.

crack

See: userzhao. Coding. Me / 2019/06/01 /…

The plugin is recommended

Lombok

Lombok is a tool that generates code through annotations at Java compile time. You need to install the IDEA plug-in and add Lombok’s Maven dependencies. The following

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
Copy the code

Commonly used annotations

  • @AllArgsConstructor: Generates the full-parameter constructor
  • @NoArgsConstructor: Generates a no-argument constructor
  • @RequiredArgsConstructorThe generated arguments are constructors for final fields and fields with constraints such as @nonNULL
  • @BuilderThe: Bulider pattern constructs objects
  • @DataIs:@Getter @Setter @RequiredArgsConstructor @ToString @EqualsAndHashCodeCombinatorial annotation of
  • @EqualsAndHashCode: automatically overrides equals and hashCode methods
  • @Getter: Generates the property getter method
  • @Setter: Generates property setter methods
  • @ToString: automatically overrides the toString method
  • @Slf4j,@Log4j,@Log4j2: Provides log support

Translation

Support three kinds of Google Translation, Youdao Translation and Baidu Translation three, personally recommended Google Translation but need to scientific Internet access or configuration agent

Idea Configure the HTTP proxy

If there is no scientific Internet access or no agent to configure, youdao Translation is recommended, but you need to go to Youdao open platform to apply for application ID and application key, click the blue word below the red box or apply here.

You can use the shortcut keys: Ctrl+Shift+Y to call out the translation interface as shown in Figure 1. You can use the shortcut keys: Ctrl+Shift+O to call out the translation interface as shown in Figure 2. Paragraph translation is also supported, as shown in Figure 3 below.

JRebel for IntelliJ

Deciphering the tutorial

See: userzhao. Coding. Me / 2019/06/01 /…

GsonFormat

Use Alt+Insert to Generate interface. Select GsonFormat to format JSON data

GenerateAllSetter

Press Alt+Enter on the User of User User to call the screen shown in Figure 1. You can select the first setter method that generates null values for all attributes of User and the second setter method that generates default values for all attributes of User. After generation, see Figure 2 below

Maven Helper

Dependency Analyzer (Dependency Analyzer) to view conflicting dependencies, list of all dependencies, tree of all dependencies, etc., and import them again. Easy to manage Maven dependencies.

PlantUML

Refer to plantuml.com/zh/index

Just a quick example, it contains some common ones

Alibaba Cloud Toolkit

Alibaba Cloud Toolkit (hereinafter referred to as Cloud Toolkit) is a plug-in for IDE platform developers to help developers develop, test, diagnose and deploy applications more efficiently. You can use Cloud Toolkit to deploy applications to the Cloud (ECS, EDAS, Container service Kubernetes edition and other Cloud products) and any server. Applications can be quickly developed, tested, and diagnosed with tools such as the embedded Arthas program diagnostics, Terminal Shell Terminal, and MySQL executor.

Reference: help.aliyun.com/product/299…

Commonly used Settings

Theme Settings

Update prompt to turn off Settings

Shortcut Settings

Idea sets a shortcut key set that is basically the same as IDEA for users who transfer from Eclipse, greatly reducing the difficulty of transferring to development tools, and supports some shortcut key changes, which is very flexible.

Automatic packet guide Settings

Vary from person to person, some people like automatic guide package controllability and can be familiar with the code are using those dependent packages, some people are afraid of trouble like automatic guide package, see preferences.

Code folding Settings

font

Color scheme Settings

Three interface and code color scheme, you can choose according to personal preference.

In Default scheme, the whole interface is in white background color, which is similar to eclipse color. Those who have just transferred from Eclipse to IDEA will be more suitable.

Darcula color scheme, the overall background color is black, high-end atmosphere, I prefer this color scheme.

The overall color scheme of High Contrast is similar to Darcula, but the difference is that the code of this color scheme is highlighted to make people more immersed in coding.

Of course, the three schemes can be freely matched. If the overall color scheme is Darcula as shown in the figure, you can also set the Java code block color scheme to Default separately, and preview the setting effect below.

Code Style Settings

Below is Tab and indent Settings in Java code. We use Tab key to indent 4 Spaces. This setting should be consistent with the team.

You are advised to keep the default setting for the space position in the Java code block. If you want to modify a space, preview it on the right.

Set the file encoding format

File encoding format setting, you can set a different encoding format for each model

Plug-in installation

Of course, if the network is walled or restricted, you can also choose to set the proxy or select files from the hard disk to install, then more flexible.

Version Control Settings

Create a Github account. The advantage of this is that many file operations are automatically versioned, and it is easier to push and pull files to and from Github.

For example, when using IDEA to clone a repository from Git, it automatically detects the repository under the login account. Of course, git Bash pull is also very convenient.

Maven Settings

Project Settings

Look at this article: blog.csdn.net/bbj12345678…

Usage tips – A must for deep users

Wall crack recommended forward and backward mouse (with side keys), the real value for money, really improve efficiency, whether browsing the web, or read the source code, can be convenient through the side key fast forward or backward, quite easy to use! Now to the subject…

Coding skills

As a Java programmer, I have written a lot of CRUD, many of which are repetitive and meaningless work, and any repetitive work can be simplified or avoided. IDEA, known as the most perfect development tool in Java, simplifies many development steps for us to some extent. Here I will illustrate how I simplify CRUD programming. If there is a better way, please do not hesitate to advise.

CRUD speed up technique

At present, general projects are separated from the front and back ends, and the back end is responsible for writing API interfaces. The back end business architecture is generally divided into controller, Service and DAO layers. Below, we use the Springboot framework to write a CRUD of user information.

Briefly write my ideas to improve efficiency, using the error prompt of IDEA and quick repair function, quickly create dependent classes and methods, write from controller, create dependent service and DAO and internal methods in turn. When creating an object, use the new object ().var to quickly create and select from the candidate name, use the plug-in according to the table structure definition, use the GenerateAllSetter plug-in to quickly generate setter methods, use the beanutils.class utility class, Quickly copy properties between objects.

The following uses the user information interface as an example to write an interface for querying user information by user name.

1. Select the parent package and press Alt+Insert to create a controller package and Alt+Insert to create a UserController class. Inject UserService, use shortcut key Alt+Enter repair function, generate UserService class.

2. Write the findUsersByName method

3. Use the repair function to quickly generate User class and service findAllUserByName method, inject userRepository.

4. Automatically generate UserRepository interface and findAllByName method.

5. Use Alt+Insert to select Test… Quickly generate unit test classes, as shown in the figure below.

Quickly generate Junit unit testing tips.

Alt+Insert call Generate screen, select Test… , breathe out the right side of the interface, including (1) may select a unit test framework or used by second class library, (2) you can specify the corresponding unit test class name, (3) you can specify the unit test class inherits the parent class, are generally not unified inheritance a parent, the parent class to write unit tests of annotations, resource initialization, mock login, resource release, such as operation, (4) specify the full path of the generated unit test class package, (5) can choose whether to generate setUp and tearDown methods, generally (3) inherit the parent class does not need to check, (6) specify which methods of the generated unit test method.

Refactoring technique

rename

The refactoring shortcut: Shift+F6 resolves all class names, method names, and variable names. It also detects variables that depend on this name according to the Settings and prompts you to make changes simultaneously. As shown in figure.

Select * from UserService; select * from UserService; select * from UserService; select * from UserService; select * from UserService; (4) renames dependent words, and (5) renames variables named after the word

Rename method and variable, no map, the method will automatically rename the name of the dependent method, if the variable, will automatically query the same variable name as the variable reference.

Extract code snippet

Select the code block with extraction and press Ctrl + Alt + M to automatically extract the code segment and generate a method, which is private by default and can be modified. In addition, the return value type and method name input parameter can be modified, as shown in Figure 1 below. After clicking Refactor, the private function as shown in Figure 2 below will be generated.

Reading source code tips

View the class UML diagram

Shortcut keys: Ctrl+Alt+U: Open the shell layer, Ctrl+Alt+Shift+U: open a new window

Arraylist. class automatically generates a UML class diagram by pressing Ctrl+Alt+Shift+U. Press Space to add any class to the UML diagram.

Below is a UML diagram of the collection utility classes reused under JDK 1.8

Translation source

Use the Translation plug-in to view methods or document annotations instantly

The debug skills

www.cnblogs.com/chiangchou/…

Summary of Shortcut keys

There are a lot of links on this network, so I won’t summarize them here.

www.open-open.com/lib/view/op…

www.jianshu.com/p/ce91cea16…

conclusion

Since I transferred from Eclipse to IDEA in June 2018, I really have no comparison and no harm. Through my own practice, I have truly experienced the convenience that IDEA brings to Java coder, no matter the visual impact on UI interface, or the more practical functions of IDEA, plus perfect and rich network resources. The main thing is that it’s a tool that really improves code efficiency and makes IDEA leapfrog Eclipse. Although switching from Eclipse to IDEA may take some time and effort to adapt to the new development environment, it is worth telling everyone from the experience of a responsible person. Once you are familiar with the tool, you will feel comfortable being in control when doing a project!

For more information, you can follow my personal blog: Yizhu Station

Also welcome to follow my official account: Yizhuxiaozhan, QR code: