在学习使用Hudson进行持续集成时,总是报这样的错误:
can't open C:\Program Files\Java\jdk1.5.0\lib\tzmappings.
Started by user anonymous Updating svn://127.0.0.1/test/quickstart/trunk At revision 886 no change for svn://127.0.0.1/test/quickstart/trunk since the previous build Parsing POMs [trunk] $ java -cp "C:\Documents and Settings\QGD\.hudson\plugins\maven-plugin\WEB-INF\lib\maven-agent-1.372.jar;E:\Program Files\Apache Software Foundation\apache-maven-2.2.1\boot\classworlds-1.1.jar" hudson.maven.agent.Main "E:\Program Files\Apache Software Foundation\apache-maven-2.2.1" "C:\Documents and Settings\QGD\.hudson\war\WEB-INF\lib\remoting-1.372.jar" "C:\Documents and Settings\QGD\.hudson\plugins\maven-plugin\WEB-INF\lib\maven-interceptor-1.372.jar" 1198 "C:\Documents and Settings\QGD\.hudson\plugins\maven-plugin\WEB-INF\lib\maven2.1-interceptor-1.2.jar" <===[HUDSON REMOTING CAPACITY]===>���channel started Executing Maven: -B -f C:\Documents and Settings\QGD\.hudson\jobs\A test project\workspace\trunk\pom.xml clean test ZoneInfo: C:\Program Files\Java\jdk1.5.0\lib\zi\ZoneInfoMappings (系统找不到指定的路径。) ZoneInfo: C:\Program Files\Java\jdk1.5.0\lib\zi\ZoneInfoMappings (系统找不到指定的路径。) ZoneInfo: C:\Program Files\Java\jdk1.5.0\lib\zi\ZoneInfoMappings (系统找不到指定的路径。) [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building quickstart [INFO] task-segment: [clean, test] [INFO] ------------------------------------------------------------------------ [INFO] [clean:clean {execution: default-clean}] [INFO] Deleting directory C:\Documents and Settings\QGD\.hudson\jobs\A test project\workspace\trunk\target [INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 1 resource [INFO] [compiler:compile {execution: default-compile}] [INFO] Compiling 1 source file to C:\Documents and Settings\QGD\.hudson\jobs\A test project\workspace\trunk\target\classes [HUDSON] Archiving C:\Documents and Settings\QGD\.hudson\jobs\A test project\workspace\trunk\pom.xml to C:\Documents and Settings\QGD\.hudson\jobs\A test project\modules\cn.ac.ceode.xtwh$quickstart\builds\2010-08-18_19-56-56\archive\cn.ac.ceode.xtwh\quickstart\0.0.1-SNAPSHOT\pom.xml [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Compilation failure Unable to locate the Javac Compiler in: C:\Program Files\Java\jdk1.5.0\..\lib\tools.jar Please ensure you are using JDK 1.4 or above and not a JRE (the com.sun.tools.javac.Main class is required). In most cases you can change the location of your Java installation by setting the JAVA_HOME environment variable. [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2 seconds [INFO] Finished at: Wed Aug 18 11:57:02 GMT 2010 [INFO] Final Memory: 8M/14M [INFO] ------------------------------------------------------------------------ channel stopped can't open C:\Program Files\Java\jdk1.5.0\lib\tzmappings. Finished: FAILURE
尽管我设定了JAVA_HOME变量的值,但是每次Hudson显示的系统只java.home 都是 C:\Program Files\Java\jre6\
不得已在Hudson的 Global properties -> Environment variables 种手动添加了java.home 为 C:\Program Files\Java\jdk1.6.0_13。但是类似的错误仍在继续。
正在一筹莫展时,发现Maven的java home 也不是JAVA_HOME的,而是其下的jre文件夹: Java home: C:\Program Files\Java\jdk1.6.0_13\jre
照这个值将Hudson的 java.home改为 C:\Program Files\Java\jdk1.6.0_13\jre,即可
上网查了一下,没找到他们之间的详细区别,以后再碰到时再探究原因吧