summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeoffrey Washburn <geoffrey.washburn@epfl.ch>2008-01-09 16:08:18 +0000
committerGeoffrey Washburn <geoffrey.washburn@epfl.ch>2008-01-09 16:08:18 +0000
commit5b273b4327cdc8295bc547a4d9df238bce5ae794 (patch)
treecb32adc06017c6b52fd0579f1d516912fe15e5c4 /src
parent064ff0081d0025b6f065ee5e1e2dbdcb0f593cbd (diff)
downloadscala-5b273b4327cdc8295bc547a4d9df238bce5ae794.tar.gz
scala-5b273b4327cdc8295bc547a4d9df238bce5ae794.tar.bz2
scala-5b273b4327cdc8295bc547a4d9df238bce5ae794.zip
I believe I've fixed the problem with ScriptRun...
I believe I've fixed the problem with ScriptRunner and Interperter running under jvm-1.4 compiling temporary classfiles with target jvm-1.5.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/InterpreterLoop.scala5
-rw-r--r--src/compiler/scala/tools/nsc/ScriptRunner.scala10
2 files changed, 15 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/InterpreterLoop.scala b/src/compiler/scala/tools/nsc/InterpreterLoop.scala
index 50973bfb71..562da8441f 100644
--- a/src/compiler/scala/tools/nsc/InterpreterLoop.scala
+++ b/src/compiler/scala/tools/nsc/InterpreterLoop.scala
@@ -278,6 +278,11 @@ class InterpreterLoop(in0: Option[BufferedReader], out: PrintWriter) {
def main(settings: Settings) {
this.settings = settings
+ val major = System.getProperty("java.class.version").split("\\.")(0)
+ if (Integer.valueOf(major).intValue < 49) {
+ this.settings.target.value = "jvm-1.4"
+ }
+
in =
in0 match {
case Some(in0) =>
diff --git a/src/compiler/scala/tools/nsc/ScriptRunner.scala b/src/compiler/scala/tools/nsc/ScriptRunner.scala
index 16648e0eec..6acccc14a2 100644
--- a/src/compiler/scala/tools/nsc/ScriptRunner.scala
+++ b/src/compiler/scala/tools/nsc/ScriptRunner.scala
@@ -385,6 +385,11 @@ object ScriptRunner {
return
}
+ val major = System.getProperty("java.class.version").split("\\.")(0)
+ if (Integer.valueOf(major).intValue < 49) {
+ settings.target.value = "jvm-1.4"
+ }
+
withCompiledScript(settings, scriptFile){compiledLocation =>
runCompiled(settings, compiledLocation, scriptArgs)
}
@@ -405,6 +410,11 @@ object ScriptRunner {
str.close()
}
+ val major = System.getProperty("java.class.version").split("\\.")(0)
+ if (Integer.valueOf(major).intValue < 49) {
+ settings.target.value = "jvm-1.4"
+ }
+
withCompiledScript(settings, scriptFile.getPath){compiledLocation =>
scriptFile.delete()
runCompiled(settings, compiledLocation, scriptArgs)