From 4f8cb21ef3123f74b9344f4dde07ed9abe800a42 Mon Sep 17 00:00:00 2001 From: Lex Spoon Date: Thu, 29 Dec 2005 01:40:30 +0000 Subject: If scala.boot.class.path is not set, then try t... If scala.boot.class.path is not set, then try to guess it based on scala.home --- src/compiler/scala/tools/nsc/Settings.scala | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/Settings.scala b/src/compiler/scala/tools/nsc/Settings.scala index 63def3b60d..9b76db2b9b 100644 --- a/src/compiler/scala/tools/nsc/Settings.scala +++ b/src/compiler/scala/tools/nsc/Settings.scala @@ -18,7 +18,24 @@ class Settings(error: String => unit) { } private val bootclasspathDefault = { val javaBcp = System.getProperty("sun.boot.class.path"); - val scalaBcp = System.getProperty("scala.boot.class.path"); + val scalaBcp = { + val explicit = System.getProperty("scala.boot.class.path"); + if(explicit != null) + explicit + else { + val scalaHome = System.getProperty("scala.home"); + if(scalaHome != null) { + val guess = new File(new File(new File(scalaHome), "lib"), "scala-library.jar"); + if(guess.exists()) + guess.getPath() + else + null + } + else + null + } + } + if (javaBcp != null && scalaBcp != null) javaBcp + File.pathSeparator + scalaBcp else if (javaBcp != null) javaBcp else if (scalaBcp != null) scalaBcp -- cgit v1.2.3