Tag Archives: IDEA IntelliJ

Fatal error matching: invalid target distribution: 11

Idea executes Maven command and prompts fatal error matching: invalid target distribution: 11

Environmental Science:

        Project JDK version: 11

        Environment variable JDK version: 1.8

        Maven version: 3.3.9

 
Querying the data, we found that when executing the Maven command, we will find the JDK version of the environment variable, so the JDK version does not match the JDK version of the project

Treatment method

1. Before executing the Maven command, execute the command:

set JAVA_HOME=D:\Java\jdk\adopt-openjdk-11.0.11

After execution, execute the Maven command

2. Modify environment variable Java_ Home, configured as jdk11 directory  

Because most of my projects use JDK1.8, only a few projects use jdk11, so I choose to use the first method  

How to quickly build JavaBean objects through JSON (IntelliJ idea — > gsonformat tutorial)

When docking with a third party, it’s very common for us to return JSON with many parameter fields, so it must take a lot of time for us to manually create JavaBeans. Bloggers have found many tools on the Internet that can automatically generate JavaBeans through JSON. Here’s a brief introduction to the plug-in gsonformat in IntelliJ idea.

1. What is gson format

As plug-in to convert JSON data format to JavaBean object.

2. Shortcut key: Ctrl + Alt + s, or settings — & gt; plugs — & gt; enter gsonformat install plugins

After the installation is completed, restart IntelliJ idea. First, you need a new class file, and then press Alt + insert to select gsonformat, or Alt + s to pop up the box and enter the string data in JSON format.

IntelliJ idea error: error: Java does not support release 5

Recommended solution: thanks to another blogger in the comments area, Fu moon, for his solution: https://blog.csdn.net/qq_ 42583206/article/details/108375173   

If the problem is solved in the above way, it can be ignored below.    

—————————————————————————————————————————————————————————————————————————————–

A new Maven project is created in IntelliJ idea. The running error is as follows: error: Java does not support release 5

Jdk9 is used for local operation. When testing Java stream operation, the error should be that the Java version used in the project compilation configuration is wrong. You need to check the Java compilation version configuration used in the project and environment.

Click “file” – & gt; “project structure” in IntelliJ to see if the Java version in “project” and “module” columns is consistent with the local version

 

If not, change to the local java version.

Click “Settings” – & gt; “bulid, execution, deployment” – & gt; “java compiler”, and set the target bytecode version to the local java version. (you can configure project bytecode version to local java version once and for all in default settings)

Default Settings:

After the above two steps have been configured, the above error will not be reported after re running.

 

Once and for all reform through labor:

Thanks to another blogger in the comments area, fumion, for his proposal: https://blog.csdn.net/qq_ 42583206/article/details/108375173