1. 程式人生 > >IntelliJ IDEA中Warning:java:源值1.5已過時, 將在未來所有發行版中刪除

IntelliJ IDEA中Warning:java:源值1.5已過時, 將在未來所有發行版中刪除

Maven專案

解決方法:

在 apache-maven-3.6.0\conf\settings.xml 新增

<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>

然後在專案的pom.xml 新增

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

之後在Project Structure --> Modules --> Language level 設定 8-Lambdas