From bba64758bb82e940c8f2108a6a365aaf6701edfe Mon Sep 17 00:00:00 2001 From: Philipp Haller Date: Fri, 17 Oct 2008 12:13:32 +0000 Subject: Use JAVA_HOME for finding javac. --- src/partest/scala/tools/partest/nest/Worker.scala | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/partest') diff --git a/src/partest/scala/tools/partest/nest/Worker.scala b/src/partest/scala/tools/partest/nest/Worker.scala index 5bc7001829..01d17950bc 100644 --- a/src/partest/scala/tools/partest/nest/Worker.scala +++ b/src/partest/scala/tools/partest/nest/Worker.scala @@ -167,9 +167,18 @@ class Worker(val fileManager: FileManager) extends Actor { def javac(outDir: File, files: List[File], output: File) { // compile using command-line javac compiler - // (assumed to be in PATH) + val javaHome = System.getenv("JAVA_HOME") + NestUI.verbose("JAVA_HOME: "+javaHome) + val javacCmd = if (javaHome == null) { + // assume the compiler is in the PATH + "javac" + } else { + // otherwise use the location suggested by JAVA_HOME + val sep = File.separator + javaHome + sep + "bin" + sep + "javac" + } - val cmd = "javac"+ + val cmd = javacCmd+ " -d "+outDir.getAbsolutePath+ " -classpath "+outDir+File.pathSeparator+CLASSPATH+ " "+files.mkString(" ") -- cgit v1.2.3