Warning:java: 源值1.5已过时, 将在未来所有发行版中删除 Warning:java: 目标值1.5已过时, 将在未来所有发行版中删除 Warning:java: 要隐藏有关已过时选项的警告, 请使用 -Xlint:-options。

Warning:java: 源值1.5已过时, 将在未来所有发行版中删除
Warning:java: 目标值1.5已过时, 将在未来所有发行版中删除
Warning:java: 要隐藏有关已过时选项的警告, 请使用 -Xlint:-options。

我用的1.8

修改maven setting.xml 中 profiles 添加以下代码

<profile>
  <id>jdk-1.8</id>
  <activation>
    <activeByDefault>true</activeByDefault>
    <jdk>1.8</jdk>
  </activation>
  <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
  </properties>
</profile>

在maven中pom.setting添加

 <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

idea设置成如下内容

SDK ——————> 1.8
level ----> 8 - Lambdas, type annotations etc.

原文地址:https://www.cnblogs.com/passer-byZe/p/12592564.html