给maven的setting中<profiles>内配置上 下面内容, 然后重启idea
<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的setting.xml文件的<profiles>标签下配置JDK1.8,以便在重启IntelliJIDEA时自动使用1.8版本进行编译。这有助于确保项目的兼容性和一致性。
1万+

被折叠的 条评论
为什么被折叠?



