summaryrefslogtreecommitdiff
path: root/setup_native/scripts
diff options
context:
space:
mode:
authorEike Rathke <erack@apache.org>2011-09-10 14:22:53 +0000
committerEike Rathke <erack@apache.org>2011-09-10 14:22:53 +0000
commit56268d5f3e5b8de7af454f276ce4b0a8a1e3be53 (patch)
treee8d885bc840b9f988cca66b51396d655ebcb6172 /setup_native/scripts
parent321701cf7fea30405f28f4e463b4f08d01c805cb (diff)
native373: #i117733# no linux jre installation on 64 bit systems
# User Ingo Schmidt <is@openoffice.org>
Diffstat (limited to 'setup_native/scripts')
-rw-r--r--setup_native/scripts/javaloader.sh56
1 files changed, 53 insertions, 3 deletions
diff --git a/setup_native/scripts/javaloader.sh b/setup_native/scripts/javaloader.sh
index e23505f586b0..bd4861f552c5 100644
--- a/setup_native/scripts/javaloader.sh
+++ b/setup_native/scripts/javaloader.sh
@@ -9,6 +9,9 @@ java_runtime_sufficient="no"
java_versions_supported="1.4 1.5 1.6"
rpm2cpio_found="no"
rpm_found="no"
+is_64bit_arch="no"
+arch64string="x86_64"
+arch64string2="64-bit"
sunjavahotspot="HotSpot"
errortext=""
errorcode=""
@@ -381,7 +384,7 @@ check_architecture()
fi
}
-find_solaris_jre()
+find_jre_in_path()
{
# 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
@@ -421,6 +424,36 @@ check_jre_version()
fi
}
+check_linux_jre_version()
+{
+ # check version of an installed JRE
+ javaoutput=`$java_runtime -version 2>&1 | head -1`
+
+ for i in $java_versions_supported; do
+ versionmatch=`echo $javaoutput | grep $i`
+ if [ ! -z "$versionmatch" ]; then
+ java_runtime_sufficient="yes"
+ break
+ fi
+ done
+}
+
+check_64bit_architecture()
+{
+ # check system architecture using "uname -m"
+ # unameoutput=`uname -m 2>&1`
+ # x64str=`echo $unameoutput | grep $arch64string`
+
+ # check system architecture using "file /usr/bin/file"
+ fileoutput=`file /usr/bin/file 2>&1`
+ x64str=`echo $fileoutput | grep $arch64string2`
+
+ if [ ! -z "$x64str" ]; then
+ is_64bit_arch="yes"
+ echo "64-bit Linux"
+ fi
+}
+
# the user might want to specify java runtime on the commandline
USAGE="Usage: $0 [ -j <java_runtime> ]"
while getopts hj: opt; do
@@ -460,10 +493,27 @@ cd "`dirname "$0"`"
if [ "$java_runtime_set" != "yes" ]; then
platform=`uname -s`
if [ "`uname -s`" = "Linux" ]; then
- install_linux_rpm
+ check_64bit_architecture
+ if [ "$is_64bit_arch" = "no" ]; then
+ install_linux_rpm
+ else
+ find_jre_in_path
+ if [ "$java_runtime_found" = "yes" ]; then
+ check_linux_jre_version
+ if [ ! "$java_runtime_sufficient" = "yes" ]; then
+ errortext="Error: Did not find a valid Java Runtime Environment (JRE). Required JRE versions: $java_versions_supported"
+ errorcode="14"
+ do_exit
+ fi
+ else
+ errortext="Error: Did not find an installed Java Runtime Environment (JRE)."
+ errorcode="15"
+ do_exit
+ fi
+ fi
elif [ "`uname -s`" = "SunOS" ]; then
check_architecture
- find_solaris_jre
+ find_jre_in_path
if [ "$java_runtime_found" = "yes" ]; then
check_jre_version
if [ ! "$java_runtime_sufficient" = "yes" ]; then