1. 把工程编译时使用JDK1.6以上版本可以解决。

    eclipse中 Preferences-->Java-->Compiler-->Configure Project Specific Settings -->选中项目-->OK-->1.6(我用的是1.8)

  2. 起初并没有得到解决,在pom.xml文件中添加:

    <plugins>

          <plugin>

            <groupId>org.apache.maven.plugins</groupId>

            <artifactId>maven-compiler-plugin</artifactId>

            <version>3.5.1</version>

            <configuration>

              <source>1.8</source>

              <target>1.8</target>

            </configuration>

          </plugin>

        </plugins>

 

相关文章:

  • 2021-07-11
  • 2022-12-23
  • 2022-02-20
  • 2021-12-30
  • 2021-10-29
  • 2022-12-23
  • 2021-11-08
  • 2021-09-13
猜你喜欢
  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
  • 2021-05-30
  • 2021-07-08
  • 2021-06-03
  • 2021-05-05
相关资源
相似解决方案