summaryrefslogtreecommitdiff
path: root/src/repl
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2013-04-23 00:58:12 -0700
committerSom Snytt <som.snytt@gmail.com>2013-05-23 01:20:24 -0700
commit63bd52781faa1192de1c87028d6ac637d535a50e (patch)
tree84a0fc87f76344a1c68164763e7f4e2c25ec7acd /src/repl
parent649d5bb3a59326ea8fb7790f6abc948951c73905 (diff)
downloadscala-63bd52781faa1192de1c87028d6ac637d535a50e.tar.gz
scala-63bd52781faa1192de1c87028d6ac637d535a50e.tar.bz2
scala-63bd52781faa1192de1c87028d6ac637d535a50e.zip
SI-7410 REPL uses improved tools.jar locator
The logic in partest for snooping around for tools.jar is moved to PathResolver, and ILoop uses it from there. If JAVA_HOME is toolless, check out java.home. The use case was that Ubuntu installs with `java` at version 6 and `javac` at version 7; it's easy to wind up with JAVA_HOME pointing at the version 6 JRE, as I discovered. It's confusing when that happens. In future, partest might run under 7 and fork tests under 6, but those permutations are downstream.
Diffstat (limited to 'src/repl')
-rw-r--r--src/repl/scala/tools/nsc/interpreter/ILoop.scala10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/repl/scala/tools/nsc/interpreter/ILoop.scala b/src/repl/scala/tools/nsc/interpreter/ILoop.scala
index f4e06f6bfc..9f841f2c44 100644
--- a/src/repl/scala/tools/nsc/interpreter/ILoop.scala
+++ b/src/repl/scala/tools/nsc/interpreter/ILoop.scala
@@ -255,16 +255,8 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
}
}
- private def findToolsJar() = {
- val jdkPath = Directory(jdkHome)
- val jar = jdkPath / "lib" / "tools.jar" toFile
+ private def findToolsJar() = PathResolver.SupplementalLocations.platformTools
- if (jar isFile)
- Some(jar)
- else if (jdkPath.isDirectory)
- jdkPath.deepFiles find (_.name == "tools.jar")
- else None
- }
private def addToolsJarToLoader() = {
val cl = findToolsJar() match {
case Some(tools) => ScalaClassLoader.fromURLs(Seq(tools.toURL), intp.classLoader)