我正在与jenkins建立一个多模块的maven项目,报告
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Failure executing javac, but could not parse the error
Fatal Error: Unable to find package java.lang in classpath or bootclasspath.
Java版
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
Maven版
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /home/local/apache-maven-3.3.9
Java version: 1.7.0_79, vendor: Oracle Corporation
Java home: /home/local/jdk1.7.0_79/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-431.el6.x86_64", arch: "amd64", family: "unix"
的pom.xml
<repositories>
<repository>
<id>nexus</id>
<name>Team Nexus Repository</name>
<url>http://192.168.0.252:8081/nexus/content/groups/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>Team Nexus Repository</name>
<url>http://192.168.0.252:8081/nexus/content/groups/public</url>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<id>nexus-releases</id>
<url>http://192.168.0.252:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<url>http://192.168.0.252:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
Linux CLASSPATH
.:/home/local/jdk1.7.0_79/lib/dt.jar:/home/local/jdk1.7.0_79/lib/tools.jar
我认为这是jdk配置问题,但jdk环境变量应该是正确的。
詹金斯环境变量:
任何帮助都将不胜感激。
答案 0 :(得分:1)
在Jenkins中打开“configure system”页面,在JDK部分添加JDK和路径,也可能需要将JAVA_HOME添加到“Global Properties - Environment Variables”。
答案 1 :(得分:0)
您需要考虑以下三件事来解决此问题:
詹金斯:
Java: -检查JAVA_HOME文件版本,并在各处相应地添加JDK版本。
行家: