1.Project Structure中的Project SDK选择1.8,Project language level选择8

 

【idea】idea编译环境改为1.8

 

2.Project Structure中Modules,选择language level为8

 

 【idea】idea编译环境改为1.8

 

3.setting中的java compiler,project bytecode version和Target bytecode version 选择1.8

 

【idea】idea编译环境改为1.8

 

其他方法:
Maven配置

 

<build>
        <pluginManagement>
            <plugins>
                <!--控制项目的language level和compile 版本-->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.3.2</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

 

相关文章:

  • 2021-12-12
  • 2021-08-04
  • 2021-04-05
  • 2021-10-20
猜你喜欢
  • 2021-06-14
  • 2021-07-12
  • 2021-04-03
  • 2021-10-09
  • 2021-12-28
  • 2021-05-22
  • 2022-01-01
相关资源
相似解决方案