summaryrefslogtreecommitdiff
path: root/setup_native/scripts/javaloader.sh
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2007-01-02 14:26:20 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2007-01-02 14:26:20 +0000
commit1174d103e48d2ebeb2b2dee0a2abc8b3a306fb1c (patch)
treef6a3241cda50c7e12ff49592fbc285a99beaaa02 /setup_native/scripts/javaloader.sh
parente025002ab79ea5c59c9b54224c2a1e8a8e4e6ddc (diff)
INTEGRATION: CWS native50 (1.1.2); FILE ADDED
2006/11/02 17:29:26 is 1.1.2.2: #i65425# including getuid_path for getuid.so 2006/07/28 14:59:54 is 1.1.2.1: #i65425# new java installer
Diffstat (limited to 'setup_native/scripts/javaloader.sh')
-rw-r--r--setup_native/scripts/javaloader.sh87
1 files changed, 87 insertions, 0 deletions
diff --git a/setup_native/scripts/javaloader.sh b/setup_native/scripts/javaloader.sh
new file mode 100644
index 000000000000..46172239d269
--- /dev/null
+++ b/setup_native/scripts/javaloader.sh
@@ -0,0 +1,87 @@
+#!/bin/sh
+
+jarfilename="JavaSetup.jar"
+java_runtime="java"
+java_runtime_set="no"
+java_runtime_found="no"
+
+# the user might want to specify java runtime on the commandline
+USAGE="Usage: $0 [ -j <java_runtime> ]"
+while getopts hj: opt; do
+ case $opt in
+ j) java_runtime_set="yes";
+ java_runtime="${OPTARG}"
+ if [ ! -f "$java_runtime" ]; then
+ echo "Invalid java runtime $java_runtime, file does not exist"
+ exit 1
+ fi
+ if [ ! -x "$java_runtime" ]; then
+ echo "Invalid java runtime $java_runtime, not an executable file"
+ exit 1
+ fi
+ ;;
+ h) echo ${USAGE}
+ exit 1
+ ;;
+ \?) echo ${USAGE}
+ exit 1
+ ;;
+ esac
+done
+
+# Search for Java, if not specified on command line
+
+if [ "$java_runtime_set" != "yes" ]; then
+ # searching for java runtime in path
+ for i in `echo $PATH | sed -e 's/^:/.:/g' -e 's/:$/:./g' -e 's/::/:.:/g' -e 's/:/ /g'`; do
+ if [ -x "$i/$java_runtime" -a ! -d "$i/$java_runtime" ]; then
+ java_runtime="$i/$java_runtime"
+ java_runtime_found="yes"
+ break;
+ fi
+ done
+
+ if [ "$java_runtime_found" != "yes" ]; then
+ echo "No Java runtime environment found. Please install Java runtime before starting $0."
+ exit 1
+ fi
+fi
+
+# check Java version (not required yet) -> every Java has to work without problems
+
+# Determining current platform
+# platform=`uname -s`
+
+# verify that we are running on the right platform -> has to be done in Java program.
+
+umask 022
+
+echo "Using $java_runtime"
+echo `$java_runtime -version`
+echo "Running installer"
+
+# looking for environment variables
+
+home=""
+if [ "x" != "x$HOME" ]; then
+ home=-DHOME=$HOME
+fi
+
+log_module_states=""
+if [ "x" != "x$LOG_MODULE_STATES" ]; then
+ log_module_states=-DLOG_MODULE_STATES=$LOG_MODULE_STATES
+fi
+
+getuid_path=""
+if [ "x" != "x$GETUID_PATH" ]; then
+ getuid_path=-DGETUID_PATH=$GETUID_PATH
+fi
+
+# changing into setup directory
+cd "`dirname "$0"`"
+
+# run the installer class file
+echo $java_runtime $home $log_module_states $setup_root_path $package_root_path -jar $jarfilename
+$java_runtime $home $log_module_states $getuid_path -jar $jarfilename
+
+exit 0