improved ISABELLE_JAVA, based on THIS_JAVA of the actually running JVM;
authorwenzelm
Sat Apr 17 20:42:26 2010 +0200 (2010-04-17 ago)
changeset 36193067a01827fca
parent 36192 d4ec9ddd0e21
child 36194 8e61560ded89
improved ISABELLE_JAVA, based on THIS_JAVA of the actually running JVM;
etc/settings
src/Pure/System/gui_setup.scala
src/Pure/System/isabelle_system.scala
src/Pure/System/standard_system.scala
     1.1 --- a/etc/settings	Sat Apr 17 19:35:35 2010 +0200
     1.2 +++ b/etc/settings	Sat Apr 17 20:42:26 2010 +0200
     1.3 @@ -55,7 +55,7 @@
     1.4  ### JVM components (Scala or Java)
     1.5  ###
     1.6  
     1.7 -ISABELLE_JAVA="java"
     1.8 +ISABELLE_JAVA="${THIS_JAVA:-java}"
     1.9  ISABELLE_SCALA="scala"
    1.10  
    1.11  [ -z "$SCALA_HOME" ] && SCALA_HOME=$(choosefrom \
     2.1 --- a/src/Pure/System/gui_setup.scala	Sat Apr 17 19:35:35 2010 +0200
     2.2 +++ b/src/Pure/System/gui_setup.scala	Sat Apr 17 20:42:26 2010 +0200
     2.3 @@ -56,6 +56,7 @@
     2.4      try {
     2.5        val isabelle_system = new Isabelle_System
     2.6        text.append("Isabelle home: " + isabelle_system.getenv("ISABELLE_HOME") + "\n")
     2.7 +      text.append("Isabelle java: " + isabelle_system.this_java())
     2.8      } catch {
     2.9        case e: RuntimeException => text.append(e.getMessage + "\n")
    2.10      }
     3.1 --- a/src/Pure/System/isabelle_system.scala	Sat Apr 17 19:35:35 2010 +0200
     3.2 +++ b/src/Pure/System/isabelle_system.scala	Sat Apr 17 20:42:26 2010 +0200
     3.3 @@ -26,7 +26,8 @@
     3.4    {
     3.5      import scala.collection.JavaConversions._
     3.6  
     3.7 -    val env0 = Map(java.lang.System.getenv.toList: _*)
     3.8 +    val env0 = Map(java.lang.System.getenv.toList: _*) +
     3.9 +      ("THIS_JAVA" -> this_java())
    3.10  
    3.11      val isabelle_home =
    3.12        env0.get("ISABELLE_HOME") match {
     4.1 --- a/src/Pure/System/standard_system.scala	Sat Apr 17 19:35:35 2010 +0200
     4.2 +++ b/src/Pure/System/standard_system.scala	Sat Apr 17 20:42:26 2010 +0200
     4.3 @@ -211,4 +211,17 @@
     4.4        }
     4.5      }
     4.6      else jvm_path
     4.7 +
     4.8 +
     4.9 +  /* this_java executable */
    4.10 +
    4.11 +  def this_java(): String =
    4.12 +  {
    4.13 +    val java_home = System.getProperty("java.home")
    4.14 +    val java_exe =
    4.15 +      if (Platform.is_windows) new File(java_home + "\\bin\\java.exe")
    4.16 +      else new File(java_home + "/bin/java")
    4.17 +    if (!java_exe.isFile) error("Expected this Java executable: " + java_exe.toString)
    4.18 +    posix_path(java_exe.getAbsolutePath)
    4.19 +  }
    4.20  }