Добрый день, пытаюсь запустить тест командой
mvn clean test site
но maven выдаёт ошибку:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TestWebDriver 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TestWebDriver ---
[INFO] Deleting C:\eclipse-workspace\TestWebDriver\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ TestWebDri
ver ---
[WARNING] Using platform encoding (Cp1251 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ TestWebDriver
---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1251, i.e. b
uild is platform dependent!
[INFO] Compiling 1 source file to C:\eclipse-workspace\TestWebDriver\target\clas
ses
[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.138 s
[INFO] Finished at: 2017-07-16T16:53:53+03:00
[INFO] Final Memory: 11M/114M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.
6.1:compile (default-compile) on project TestWebDriver: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on
a JRE rather than a JDK?
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption
как я понимаю что ему нужна jdk но как на её указать в поме я прописывал адрес но появляется другая
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TestWebDriver 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TestWebDriver ---
[INFO] Deleting C:\eclipse-workspace\TestWebDriver\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ TestWebDri
ver ---
[WARNING] Using platform encoding (Cp1251 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ TestWebDriver
---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1251, i.e. b
uild is platform dependent!
[INFO] Compiling 1 source file to C:\eclipse-workspace\TestWebDriver\target\clas
ses
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.851 s
[INFO] Finished at: 2017-07-16T17:09:44+03:00
[INFO] Final Memory: 11M/114M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.
6.1:compile (default-compile) on project TestWebDriver: Compilation failure -> [
Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption
Ответ
[ERROR] No compiler is provided in this environment. Perhaps you are running on
a JRE rather than a JDK?
Maven не может найти установленную версию jdk на локальном компьютере.
Попробуйте поменять переменную JAVA_HOME.
На Linux
export JAVA_HOME=/usr/java/jdk1.5.0_07/bin/java
В Windows через командную строку сделать (естественно поменять путь к своей java):
set JAVA_HOME="C:\Java\jdk7"
Альтернативный вариант на Windows
Взято отсюда -> https://www.java.com/ru/download/help/path.xml
Windows 10 и Windows 8
В строке "Поиск" выполните поиск: Система (Панель управления)
Нажмите на ссылку Дополнительные параметры системы.
Нажмите
Переменные среды. В разделе Переменные среды выберите переменную
среды PATH. Нажмите Изменить. Если переменной PATH не существует,
нажмите Создать.
В окне Изменение системной переменной (или Новая
системная переменная) укажите значение переменной среды PATH.
Нажмите ОК. Закройте остальные открытые окна, нажимая ОК.
Откройте заново окно командной строки и выполните код java.
Комментариев нет:
Отправить комментарий