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

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

问题描述

从命令行运行的 mvn clean test 说,在这个环境中没有提供编译器,也许你是在 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.

推荐答案

假设 windows 和您的实际目录可能不同,请确保:

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:opensourceapache-maven-3.3.9
Java version: 1.8.0_92, vendor: Oracle Corporation
Java home: C:PROGRA~1Javajdk1.8.0_92jre
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天全站免登陆