more official initial class path according to sun.misc.Launcher;
authorwenzelm
Wed, 11 Sep 2013 23:32:47 +0200
changeset 53575 df79aa33bb74
parent 53574 cb7d8e70f4f4
child 53576 793a429c63e7
more official initial class path according to sun.misc.Launcher;
src/Pure/Tools/main.scala
src/Tools/jEdit/src/scala_console.scala
--- a/src/Pure/Tools/main.scala	Wed Sep 11 22:46:51 2013 +0200
+++ b/src/Pure/Tools/main.scala	Wed Sep 11 23:32:47 2013 +0200
@@ -16,20 +16,6 @@
 
 object Main
 {
-  /** class path **/
-
-  def class_path: List[Path] = List(
-    "$ISABELLE_HOME/lib/classes/ext/Pure.jar",
-    "$ISABELLE_HOME/lib/classes/ext/scala-compiler.jar",
-    "$ISABELLE_HOME/lib/classes/ext/scala-library.jar",
-    "$ISABELLE_HOME/lib/classes/ext/scala-swing.jar",
-    "$ISABELLE_HOME/lib/classes/ext/scala-actors.jar",
-    "$ISABELLE_HOME/lib/classes/ext/scala-reflect.jar",
-    "$ISABELLE_HOME/src/Tools/jEdit/dist/jedit.jar"
-  ).map(Path.explode(_))
-
-
-
   /** main entry point **/
 
   def main(args: Array[String])
--- a/src/Tools/jEdit/src/scala_console.scala	Wed Sep 11 22:46:51 2013 +0200
+++ b/src/Tools/jEdit/src/scala_console.scala	Wed Sep 11 23:32:47 2013 +0200
@@ -46,9 +46,17 @@
         find_files(new JFile(start),
           entry => entry.isFile && entry.getName.endsWith(".jar")).map(_.getAbsolutePath)
       else Nil
+
+    val initial_class_path =
+      System.getProperty("java.class.path") match {
+        case null => Nil
+        case class_path => Library.space_explode(JFile.pathSeparatorChar, class_path)
+      }
+
     val path =
-      Main.class_path.map(Isabelle_System.platform_file(_)) :::
-      find_jars(jEdit.getSettingsDirectory) ::: find_jars(jEdit.getJEditHome)
+      initial_class_path :::
+      find_jars(jEdit.getSettingsDirectory) :::
+      find_jars(jEdit.getJEditHome)
     path.mkString(JFile.pathSeparator)
   }