Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.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内置错误_Java_Eclipse_Maven - Fatal编程技术网

Java Maven内置错误

Java Maven内置错误,java,eclipse,maven,Java,Eclipse,Maven,我在尝试进行maven构建时遇到以下错误 未能在项目上执行目标org.apache.maven.plugins:maven编译器plugin:3.7.0:compile(默认编译) Maven版本是3.5.3。maven编译器插件版本为3.7.0。有什么问题吗 我安装了jdk1.8。因此,这是eclipse中使用的默认版本。 在pom.xml中指定的插件如下(它是自动生成的) 请尝试从下面的路径编辑jre,使其指向jdk- Window>Preferences>Java>Installed JR

我在尝试进行maven构建时遇到以下错误

未能在项目上执行目标org.apache.maven.plugins:maven编译器plugin:3.7.0:compile(默认编译)

Maven版本是3.5.3。maven编译器插件版本为3.7.0。有什么问题吗

我安装了jdk1.8。因此,这是eclipse中使用的默认版本。
在pom.xml中指定的插件如下(它是自动生成的)


请尝试从下面的路径编辑jre,使其指向jdk-


Window>Preferences>Java>Installed JRE

根据问题中的信息,问题可能出在代码中。您可以添加完整的错误吗?通常maven会提供更多关于到底是什么出错的信息。对于(甚至)更详细的信息:使用flag-xd重复该命令不同版本的maven和插件不应该是一个问题。你应该得到一个更详细的错误消息后,你已经张贴。它在这里回答可能的重复
<plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.7.0</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.0.0</version>
        <configuration>
          <warSourceDirectory>WebContent</warSourceDirectory>
        </configuration>
      </plugin>
    </plugins>
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building SpringEg1.0 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ SpringMVC ---
[INFO] Deleting C:\Users\Sreevidya Aravind\eclipse-workspace\SpringExample\target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ SpringMVC ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\Sreevidya Aravind\eclipse-workspace\SpringExample\src\main\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ SpringMVC ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\Sreevidya Aravind\eclipse-workspace\SpringExample\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.225 s
[INFO] Finished at: 2018-06-01T18:07:39+05:30
[INFO] Final Memory: 9M/112M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project SpringMVC: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException