ERROR Source option 1.5 is no longer supported. Use 1.6 or later

后端 未结 10 967
[愿得一人]
[愿得一人] 2020-12-24 04:32

It all happens when I was trying to build a springboot application by ./mvnw clean install

When I first run the install command, it runs into followin

相关标签:
10条回答
  • 2020-12-24 05:03

    Make sure you have following configuration in your pom.xml file.

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
    
    0 讨论(0)
  • 2020-12-24 05:07

    For me the solution was to set the version of the maven compiler plugin to 3.8.0 and specify the release (9 for in your case, 11 in mine)

        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.0</version>
          <configuration>
            <release>11</release>
          </configuration>
        </plugin>
    
    0 讨论(0)
  • 2020-12-24 05:07

    There can be corrupted jar file for which it may show error as "ZipFile invalid LOC header (bad signature)" You need to delete all jar files for which it shows the error and add this Dependency

     <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>3.0-alpha-1</version>
        <scope>provided</scope>
    </dependency>
    
    0 讨论(0)
  • 2020-12-24 05:14

    In IntelliJ:

    1. Open Project Structure (⌘;) > Modules > YOUR MODULE -> Language level: set 9, in your case.
    2. Repeat for each module.

    0 讨论(0)
提交回复
热议问题