diff options
author | Philipp Haller <hallerp@gmail.com> | 2008-10-17 12:13:32 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2008-10-17 12:13:32 +0000 |
commit | bba64758bb82e940c8f2108a6a365aaf6701edfe (patch) | |
tree | 97032d3ccd39fef2d1fb0e8da09dfa25f903be33 | |
parent | cc441db380d16f0d61837257f025c6a996e2d415 (diff) | |
download | scala-bba64758bb82e940c8f2108a6a365aaf6701edfe.tar.gz scala-bba64758bb82e940c8f2108a6a365aaf6701edfe.tar.bz2 scala-bba64758bb82e940c8f2108a6a365aaf6701edfe.zip |
Use JAVA_HOME for finding javac.
-rw-r--r-- | src/partest/scala/tools/partest/nest/Worker.scala | 13 |
1 files changed, 11 insertions, 2 deletions
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(" ") |