Blame SOURCES/altjava.patch

789770
--- IcedTea-Web-icedtea-web-1.8.4/shell-launcher/launchers.sh.in
789770
+++ iIcedTea-Web-cedtea-web-1.8.4/shell-launcher/launchers.sh.in
789770
@@ -193,6 +193,12 @@
789770
   shift
789770
 done
789770
 
789770
+java_dir="`dirname ${JAVA}`"
789770
+alt_java="alt-java"
789770
+if [ -e "$java_dir/$alt_java" ] ; then
789770
+  JAVA="`dirname ${JAVA}`/$alt_java"
789770
+fi
789770
+
789770
 # TODO: inline args without using COMMAND[array] to unify linux/windows scripts
789770
 k=0
789770
 COMMAND[k]="${JAVA}"
789770
--- IcedTea-Web-icedtea-web-1.8.4/rust-launcher/src/os_access.rs
789770
+++ IcedTea-Web-icedtea-web-1.8.4/rust-launcher/src/os_access.rs
789770
@@ -5,9 +5,19 @@
789770
 use log_helper;
789770
 
789770
 pub fn create_java_cmd(os: &Os,jre_dir: &std::path::PathBuf, args: &Vec<String>) -> std::process::Command {
789770
-    let mut bin_java = jre_dir.clone();
789770
-    bin_java.push("bin");
789770
-    bin_java.push("java");
789770
+    let mut alt_bin_java = jre_dir.clone();
789770
+    alt_bin_java.push("bin");
789770
+    alt_bin_java.push("alt-java");
789770
+    let mut bin_java;
789770
+    if alt_bin_java.exists() {
789770
+        os.log("itw-rust-debug: alt-java found");
789770
+        bin_java = alt_bin_java;
789770
+    } else {
789770
+        os.log("itw-rust-debug: alt-java NOT found");
789770
+        bin_java = jre_dir.clone();
789770
+        bin_java.push("bin");
789770
+        bin_java.push("java");
789770
+    }
789770
     let mut cmd = std::process::Command::new(&bin_java);
789770
     for ar in args.into_iter() {
789770
         cmd.arg(ar);