summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorLex Spoon <lex@lexspoon.org>2005-12-29 01:40:30 +0000
committerLex Spoon <lex@lexspoon.org>2005-12-29 01:40:30 +0000
commit4f8cb21ef3123f74b9344f4dde07ed9abe800a42 (patch)
tree99ad91bb54ccf6667dafefa7be9e5eca253baf42 /src/compiler
parentb846b44bb76e6584a9216246e2a6623447511a4e (diff)
downloadscala-4f8cb21ef3123f74b9344f4dde07ed9abe800a42.tar.gz
scala-4f8cb21ef3123f74b9344f4dde07ed9abe800a42.tar.bz2
scala-4f8cb21ef3123f74b9344f4dde07ed9abe800a42.zip
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
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/Settings.scala19
1 files changed, 18 insertions, 1 deletions
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