ISABELLE_JDK_HOME settings variable points to JDK with javac and jar (not just JRE);
authorwenzelm
Sat Mar 24 20:24:16 2012 +0100 (2012-03-24)
changeset 47113b5a5662528fb
parent 47112 8493d5d0e9b6
child 47114 7c9e31ffcd9e
child 47117 9890d4f0c1db
child 47122 790fb5eb5969
ISABELLE_JDK_HOME settings variable points to JDK with javac and jar (not just JRE);
update for prospective jdk1.7.x component;
Admin/java/README
Admin/java/etc/settings
NEWS
etc/settings
lib/Tools/java
lib/browser/build
src/Pure/System/gui_setup.scala
src/Pure/System/isabelle_system.scala
src/Pure/System/standard_system.scala
src/Pure/build-jars
src/Tools/JVM/java_ext_dirs
src/Tools/jEdit/lib/Tools/jedit
     1.1 --- a/Admin/java/README	Mon Mar 26 11:15:41 2012 +0200
     1.2 +++ b/Admin/java/README	Sat Mar 24 20:24:16 2012 +0100
     1.3 @@ -1,2 +1,3 @@
     1.4 -This is JRE 1.6.0_22 for Linux and Linux x86 from
     1.5 -http://www.java.com/en/download/manual.jsp
     1.6 +This is JDK 1.7.0_03 for Linux and Linux x86 from
     1.7 +http://www.oracle.com/technetwork/java/javase/downloads/index.html
     1.8 +
     2.1 --- a/Admin/java/etc/settings	Mon Mar 26 11:15:41 2012 +0200
     2.2 +++ b/Admin/java/etc/settings	Sat Mar 24 20:24:16 2012 +0100
     2.3 @@ -1,2 +1,4 @@
     2.4 -JAVA_HOME="$COMPONENT/${ISABELLE_PLATFORM64:-$ISABELLE_PLATFORM}/jre1.6.0_22"
     2.5 -ISABELLE_JAVA="$JAVA_HOME/bin/java"
     2.6 +# -*- shell-script -*- :mode=shellscript:
     2.7 +
     2.8 +ISABELLE_JDK_HOME="$COMPONENT/${ISABELLE_PLATFORM64:-$ISABELLE_PLATFORM}/jdk1.7.0_03"
     2.9 +
     3.1 --- a/NEWS	Mon Mar 26 11:15:41 2012 +0200
     3.2 +++ b/NEWS	Sat Mar 24 20:24:16 2012 +0100
     3.3 @@ -45,6 +45,10 @@
     3.4  header -- minor INCOMPATIBILITY for user-defined commands.  Allow new
     3.5  commands to be used in the same theory where defined.
     3.6  
     3.7 +* ISABELLE_JDK_HOME settings variable points to JDK with javac and jar
     3.8 +(not just JRE), derived from JAVA_HOME from the shell environment or
     3.9 +java.home of the running JVM.
    3.10 +
    3.11  
    3.12  *** Pure ***
    3.13  
     4.1 --- a/etc/settings	Mon Mar 26 11:15:41 2012 +0200
     4.2 +++ b/etc/settings	Sat Mar 24 20:24:16 2012 +0100
     4.3 @@ -54,10 +54,12 @@
     4.4  ### JVM components (Scala or Java)
     4.5  ###
     4.6  
     4.7 -if [ -n "$JAVA_HOME" ]; then
     4.8 -  ISABELLE_JAVA="$JAVA_HOME/bin/java"
     4.9 -else
    4.10 -  ISABELLE_JAVA="java"
    4.11 +if [ -z "$ISABELLE_JDK_HOME" -a -n "$JAVA_HOME" ]; then
    4.12 +  if [ "$(basename "$JAVA_HOME")" = jre -a -e "$(dirname "$JAVA_HOME")"/bin/javac ]; then
    4.13 +    ISABELLE_JDK_HOME="$(dirname "$JAVA_HOME")"
    4.14 +  else
    4.15 +    ISABELLE_JDK_HOME="$JAVA_HOME"
    4.16 +  fi
    4.17  fi
    4.18  
    4.19  ISABELLE_SCALA_BUILD_OPTIONS="-nowarn -target:jvm-1.5"
     5.1 --- a/lib/Tools/java	Mon Mar 26 11:15:41 2012 +0200
     5.2 +++ b/lib/Tools/java	Sat Mar 24 20:24:16 2012 +0100
     5.3 @@ -6,7 +6,7 @@
     5.4  
     5.5  CLASSPATH="$(jvmpath "$CLASSPATH")"
     5.6  
     5.7 -JAVA_EXE="${THIS_JAVA:-$ISABELLE_JAVA}"
     5.8 +JAVA_EXE="$ISABELLE_JDK_HOME/bin/java"
     5.9  
    5.10  if "$JAVA_EXE" -version >/dev/null 2>/dev/null; then
    5.11    :
     6.1 --- a/lib/browser/build	Mon Mar 26 11:15:41 2012 +0200
     6.2 +++ b/lib/browser/build	Sat Mar 24 20:24:16 2012 +0100
     6.3 @@ -65,9 +65,9 @@
     6.4  
     6.5    rm -rf classes && mkdir classes
     6.6  
     6.7 -  javac -d classes -source 1.4 "${SOURCES[@]}" || \
     6.8 +  "$ISABELLE_JDK_HOME/bin/javac" -d classes -source 1.4 "${SOURCES[@]}" || \
     6.9      fail "Failed to compile sources"
    6.10 -  jar cf "$(jvmpath "$TARGET")" -C classes . ||
    6.11 +  "$ISABELLE_JDK_HOME/bin/jar" cf "$(jvmpath "$TARGET")" -C classes . ||
    6.12      fail "Failed to produce $TARGET"
    6.13  
    6.14    rm -rf classes
     7.1 --- a/src/Pure/System/gui_setup.scala	Mon Mar 26 11:15:41 2012 +0200
     7.2 +++ b/src/Pure/System/gui_setup.scala	Sat Mar 24 20:24:16 2012 +0100
     7.3 @@ -43,6 +43,7 @@
     7.4        text.append("Cygwin root: " + Cygwin.check_root() + "\n")
     7.5      text.append("JVM name: " + Platform.jvm_name + "\n")
     7.6      text.append("JVM platform: " + Platform.jvm_platform + "\n")
     7.7 +    text.append("JVM home: " + java.lang.System.getProperty("java.home") + "\n")
     7.8      try {
     7.9        Isabelle_System.init()
    7.10        text.append("ML platform: " + Isabelle_System.getenv("ML_PLATFORM") + "\n")
    7.11 @@ -50,7 +51,7 @@
    7.12        val platform64 = Isabelle_System.getenv("ISABELLE_PLATFORM64")
    7.13        if (platform64 != "") text.append("Isabelle platform (64 bit): " + platform64 + "\n")
    7.14        text.append("Isabelle home: " + Isabelle_System.getenv("ISABELLE_HOME") + "\n")
    7.15 -      text.append("Isabelle java: " + Isabelle_System.getenv("THIS_JAVA") + "\n")
    7.16 +      text.append("Isabelle jdk home: " + Isabelle_System.getenv("ISABELLE_JDK_HOME") + "\n")
    7.17      }
    7.18      catch { case ERROR(msg) => text.append(msg + "\n") }
    7.19  
     8.1 --- a/src/Pure/System/isabelle_system.scala	Mon Mar 26 11:15:41 2012 +0200
     8.2 +++ b/src/Pure/System/isabelle_system.scala	Sat Mar 24 20:24:16 2012 +0100
     8.3 @@ -51,7 +51,7 @@
     8.4        val settings =
     8.5        {
     8.6          val env = Map(System.getenv.toList: _*) +
     8.7 -          ("THIS_JAVA" -> standard_system.this_java())
     8.8 +          ("ISABELLE_JDK_HOME" -> standard_system.this_jdk_home())
     8.9  
    8.10          val isabelle_home =
    8.11            if (this_isabelle_home != null) this_isabelle_home
     9.1 --- a/src/Pure/System/standard_system.scala	Mon Mar 26 11:15:41 2012 +0200
     9.2 +++ b/src/Pure/System/standard_system.scala	Sat Mar 24 20:24:16 2012 +0100
     9.3 @@ -333,15 +333,17 @@
     9.4      else jvm_path
     9.5  
     9.6  
     9.7 -  /* this_java executable */
     9.8 +  /* JDK home of running JVM */
     9.9  
    9.10 -  def this_java(): String =
    9.11 +  def this_jdk_home(): String =
    9.12    {
    9.13      val java_home = System.getProperty("java.home")
    9.14 -    val java_exe =
    9.15 -      if (Platform.is_windows) new File(java_home + "\\bin\\java.exe")
    9.16 -      else new File(java_home + "/bin/java")
    9.17 -    if (!java_exe.isFile) error("Expected this Java executable: " + java_exe.toString)
    9.18 -    posix_path(java_exe.getAbsolutePath)
    9.19 +    val home = new File(java_home)
    9.20 +    val parent = home.getParent
    9.21 +    val jdk_home =
    9.22 +      if (home.getName == "jre" && parent != null &&
    9.23 +          (new File(new File(parent, "bin"), "javac")).exists) parent
    9.24 +      else java_home
    9.25 +    posix_path(jdk_home)
    9.26    }
    9.27  }
    10.1 --- a/src/Pure/build-jars	Mon Mar 26 11:15:41 2012 +0200
    10.2 +++ b/src/Pure/build-jars	Sat Mar 24 20:24:16 2012 +0100
    10.3 @@ -186,7 +186,7 @@
    10.4    mkdir -p "$(dirname "$CHARSET_SERVICE")"
    10.5    echo isabelle.Isabelle_Charset_Provider > "$CHARSET_SERVICE"
    10.6  
    10.7 -  jar cfe "$(jvmpath "$TARGET")" isabelle.GUI_Setup META-INF isabelle || \
    10.8 +  "$ISABELLE_JDK_HOME/bin/jar" cfe "$(jvmpath "$TARGET")" isabelle.GUI_Setup META-INF isabelle || \
    10.9      fail "Failed to produce $TARGET"
   10.10  
   10.11    cp "$SCALA_HOME/lib/scala-swing.jar" "$SCALA_HOME/lib/scala-library.jar" "$TARGET_DIR/ext"
    11.1 --- a/src/Tools/JVM/java_ext_dirs	Mon Mar 26 11:15:41 2012 +0200
    11.2 +++ b/src/Tools/JVM/java_ext_dirs	Sat Mar 24 20:24:16 2012 +0100
    11.3 @@ -17,7 +17,7 @@
    11.4  
    11.5  ## main
    11.6  
    11.7 -JAVA_EXE="${THIS_JAVA:-$ISABELLE_JAVA}"
    11.8 -exec "$JAVA_EXE" -classpath "$(jvmpath "$ISABELLE_HOME/src/Tools/JVM/java_ext_dirs.jar")" \
    11.9 +exec "$ISABELLE_JDK_HOME/bin/java" \
   11.10 +  -classpath "$(jvmpath "$ISABELLE_HOME/src/Tools/JVM/java_ext_dirs.jar")" \
   11.11    isabelle.Java_Ext_Dirs "$(jvmpath "$ISABELLE_HOME/lib/classes/ext")"
   11.12  
    12.1 --- a/src/Tools/jEdit/lib/Tools/jedit	Mon Mar 26 11:15:41 2012 +0200
    12.2 +++ b/src/Tools/jEdit/lib/Tools/jedit	Sat Mar 24 20:24:16 2012 +0100
    12.3 @@ -248,7 +248,7 @@
    12.4    ) || fail "Failed to compile sources"
    12.5  
    12.6    cd dist/classes
    12.7 -  jar cf "../jars/Isabelle-jEdit.jar" * || failed
    12.8 +  "$ISABELLE_JDK_HOME/bin/jar" cf "../jars/Isabelle-jEdit.jar" * || failed
    12.9    cd ../..
   12.10    rm -rf dist/classes
   12.11  fi