Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Maven编译错误(要求更高的JDK版本)_Java_Maven_Intellij Idea - Fatal编程技术网

Java Maven编译错误(要求更高的JDK版本)

Java Maven编译错误(要求更高的JDK版本),java,maven,intellij-idea,Java,Maven,Intellij Idea,今天我做了一个新项目,想用Maven编译(我在IntelliJ上运行它)。确保将JDK级别更改为1.8,这是我当前使用的,我尝试编译,并且我收到了很多异常,要求我使用“-source 8”参数,因为默认值是1.5,并且我正在使用较新JDK版本的功能 我已经很长时间没有使用IntelliJ了,有谁能告诉我如何更改这些Maven编译参数或如何解决此问题吗?您可以将其添加到pom.xml中吗 <plugin> <groupId>org.apache.maven.plugin

今天我做了一个新项目,想用Maven编译(我在IntelliJ上运行它)。确保将JDK级别更改为1.8,这是我当前使用的,我尝试编译,并且我收到了很多异常,要求我使用“-source 8”参数,因为默认值是1.5,并且我正在使用较新JDK版本的功能


我已经很长时间没有使用IntelliJ了,有谁能告诉我如何更改这些Maven编译参数或如何解决此问题吗?

您可以将其添加到pom.xml中吗

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.6.1</version>
  <configuration>
    <source>1.8</source>
    <target>1.8</target>
  </configuration>
</plugin>

org.apache.maven.plugins

嘿,这对我很有用。谢谢此外,这似乎有点离题,但您知道有没有一种简单的方法可以将普通库导入我的pom?请参阅: