ฉันพยายามทำการเปลี่ยนแปลง Intellij IDEA ดังนี้:
1
File >> Settings >> Build, Execution, Deployment >> Compiler >> Java Compiler >> project bytecode version: 1.8 >> Per-module bytecode version: 1.8
2
File >> Project Structure >> Project Settings >> Project >> SDK : 1.8, Project Language : 8 - Lambdas
File >> Project Structure >> Project Settings >> Modules >> abc : Language level: 8 - Lambdas
แต่ไม่มีอะไรทำงานมันกลับเวอร์ชันเป็น java 1.5 ทันทีที่ฉันบันทึกไว้
อย่างไรก็ตามการเพิ่มบรรทัดด้านล่างลงในรูท (ระดับโครงการ) pom.xml ทำงานให้ฉันแก้ไขปัญหาข้างต้น: (ตัวเลือกทั้งสองทำงานสำหรับฉัน)
ตัวเลือกที่ 1:
<properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>
ตัวเลือก 2:
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>
               
              
File -> Project Structure -> Project :: Project language levelเปลี่ยนเป็นDiamonds, ARM, multi-catch etc?