通过命令行运行时,Maven编译错误-Cucumber Maven Project [英] Maven compilation error when run through command line - Cucumber Maven Project

查看:127
本文介绍了通过命令行运行时,Maven编译错误-Cucumber Maven Project的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从命令行运行的mvn clean测试说,在此环境中未提供编译器,也许您是在JRE而不是JDK上运行.

mvn clean test running from command line says , No Compiler is provided in this environment , perhaps you are running on JRE rather than a JDK.

在首选项中选择已安装的JRE"作为最新的JDK,仍然出现上述错误. 当运行单个功能文件时,正在执行旧代码(即,尽管我注释了场景中的几个步骤,但它们正在执行)

Selected Installed JRE's as latest JDK in preferences, still am getting the above error. When running single feature file , the old code is being executed (i.e. though i comment out few steps from the scenario , they are being executed)

使用Jenkins进行构建时,相同的代码可以正常工作.

Same code when building with Jenkins is working fine.

推荐答案

假设窗口和实际目录可能有所不同,请确保:

Assuming windows and your actual directories may vary, make sure :

1)您的JAVA_HOME环境变量设置为.../jdk1.8/目录

1) Your JAVA_HOME environment variable is set to .../jdk1.8/ directory

2)您的M2_HOME设置为../apache-maven-3 ....目录

2) Your M2_HOME is set to your ../apache-maven-3.... directory

3)%JAVA_HOME%/bin& %M2_HOME%/bin在您的路径中

3) %JAVA_HOME%/bin & %M2_HOME%/bin are in your path

4)使用mvn -version进行检查,您应该会看到类似以下内容的

4) Check this with mvn -version, you should see something like:

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T16:41:47+00:00)
Maven home: C:\opensource\apache-maven-3.3.9
Java version: 1.8.0_92, vendor: Oracle Corporation
Java home: C:\PROGRA~1\Java\jdk1.8.0_92\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"

这篇关于通过命令行运行时,Maven编译错误-Cucumber Maven Project的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆