第一种:使用build path进行旧版本删除,增加新版本
第二种:右键项目-》属性-》Project Factors -》 java version 改版本
第三种:使用maven统一版本
如:pom.xml
<profiles> <profile> <id>jdk-17</id> <activation> <activeByDefault>true</activeByDefault> // 表示激活 <jdk>1.7</jdk> </activation> <properties> <maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion> </properties> </profile> </profiles>
如:

如果可以动态版本高低呢?
可以在配置properties那里使用

                
            
        
浙公网安备 33010602011771号