在Jenkins Maven中运行构建时抱怨JDK。我非常清楚这是env变量的一些挑战。我已将JAVA_HOME设置为JDK安装路径但没有运气。我搜索了整个网络,并知道其他人已经面对这个,但他们的解决方案对我不起作用。任何帮助将非常感激 !
[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
FYR,我的maven版本输出。
root@zarvis:~# mvn -version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T17:27:37+05:30)
Maven home: /usr/local/apache-maven-3.3.3
Java version: 1.7.0_101, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "3.19.0-31-generic", arch: "amd64", family: "unix"
JAVA_HOME已设置但不确定为什么maven会将其附加到JRE。
root@zarvis:~# echo $JAVA_HOME
/usr/lib/jvm/java-1.7.0-openjdk-amd64
提前致谢!
答案 0 :(得分:0)
尝试将JDK_HOME添加到路径