Maven compilation error when run through command l

2019-03-06 01:23发布

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条回答
再贱就再见
2楼-- · 2019-03-06 02:02

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"
查看更多
登录 后发表回答