Tag Archives: Error:java: error: release version 5 not supported & Switch

[Solved] Error:java: error: release version 5 not supported & Switch Unrecognized String

 

There will be such a problem when importing project and build from other places

At present, the local is openjdk11.0.2

Change the idea configuration as follows

File > Settings

If STR in switch is string type, the following two parts should be changed:

File > project structure

However, when the POM changes and rebuilds, the above three settings will automatically change back to the default settings, so the & lt; project> Add the Maven compiler plugin plug-in, and specify the JDK version to be used by JDK (I currently use openjdk 11.0.2, and I find that it’s OK to directly configure an 11, and the settings in the above three places will automatically change to the 11 option)

<build>
<plugins>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.7.0</version>
    <configuration>
        <source>11</source>
        <target>11</target>
    </configuration>
</plugin>
</plugins>
</build>