解决idea中maven默认jdk为1.5的问题 : IntelliJ IDEA 源值1.5已过时,将在未来所有版本中删除

解决idea中maven默认jdk为1.5的问题

最近运行总是报警告:

IntelliJ IDEA 源值1.5已过时,将在未来所有版本中删除

发现是jdk版本问题, 即使自己修改structure中的版本, 还是会变回来, 经过百度后得知需要修改pom.xml就可以解决

修改pom.xml

这里<maven.compiler.source>11</maven.compiler.source>中的11就是指定jdk的版本

要根据自己实际情况来修改

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


  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.7.0</version>
      </plugin>
    </plugins>
  </build>

猜你喜欢

转载自www.cnblogs.com/richardwlee/p/10755643.html