Maven compilation error when run through command line - Cucumber Maven Project

妖精的绣舞 提交于 2019-12-31 05:48:08

问题


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.

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)

Same code when building with Jenkins is working fine.


回答1:


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

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

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

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

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"


来源:https://stackoverflow.com/questions/46049166/maven-compilation-error-when-run-through-command-line-cucumber-maven-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!