javaloader.sh (cdf0e10c) javaloader.sh (638711ac)
1#!/bin/sh
2
3jarfilename="JavaSetup.jar"
4tempdir=/var/tmp/install_$$
5java_runtime="java"
6java_runtime_set="no"
7java_runtime_found="no"
8java_runtime_sufficient="no"
9java_versions_supported="1.4 1.5 1.6"
10rpm2cpio_found="no"
11rpm_found="no"
1#!/bin/sh
2
3jarfilename="JavaSetup.jar"
4tempdir=/var/tmp/install_$$
5java_runtime="java"
6java_runtime_set="no"
7java_runtime_found="no"
8java_runtime_sufficient="no"
9java_versions_supported="1.4 1.5 1.6"
10rpm2cpio_found="no"
11rpm_found="no"
12is_64bit_arch="no"
13arch64string="x86_64"
14arch64string2="64-bit"
12sunjavahotspot="HotSpot"
13errortext=""
14errorcode=""
15
16start_java()
17{
18 umask 022
19

--- 356 unchanged lines hidden (view full) ---

376 echo "Warning: This is an attempt to install Solaris x86 packages on Solaris Sparc."
377 else
378 echo "Warning: This is an attempt to install Solaris Sparc packages on Solaris x86."
379 fi
380 fi
381 fi
382}
383
15sunjavahotspot="HotSpot"
16errortext=""
17errorcode=""
18
19start_java()
20{
21 umask 022
22

--- 356 unchanged lines hidden (view full) ---

379 echo "Warning: This is an attempt to install Solaris x86 packages on Solaris Sparc."
380 else
381 echo "Warning: This is an attempt to install Solaris Sparc packages on Solaris x86."
382 fi
383 fi
384 fi
385}
386
384find_solaris_jre()
387find_jre_in_path()
385{
386 # searching for java runtime in path
387 for i in `echo $PATH | sed -e 's/^:/.:/g' -e 's/:$/:./g' -e 's/::/:.:/g' -e 's/:/ /g'`; do
388 if [ -x "$i/$java_runtime" -a ! -d "$i/$java_runtime" ]; then
389 java_runtime="$i/$java_runtime"
390 java_runtime_found="yes"
391 break
392 fi

--- 23 unchanged lines hidden (view full) ---

416 java_runtime_sufficient="yes"
417 break
418 fi
419 done
420 fi
421 fi
422}
423
388{
389 # searching for java runtime in path
390 for i in `echo $PATH | sed -e 's/^:/.:/g' -e 's/:$/:./g' -e 's/::/:.:/g' -e 's/:/ /g'`; do
391 if [ -x "$i/$java_runtime" -a ! -d "$i/$java_runtime" ]; then
392 java_runtime="$i/$java_runtime"
393 java_runtime_found="yes"
394 break
395 fi

--- 23 unchanged lines hidden (view full) ---

419 java_runtime_sufficient="yes"
420 break
421 fi
422 done
423 fi
424 fi
425}
426
427check_linux_jre_version()
428{
429 # check version of an installed JRE
430 javaoutput=`$java_runtime -version 2>&1 | head -1`
431
432 for i in $java_versions_supported; do
433 versionmatch=`echo $javaoutput | grep $i`
434 if [ ! -z "$versionmatch" ]; then
435 java_runtime_sufficient="yes"
436 break
437 fi
438 done
439}
440
441check_64bit_architecture()
442{
443 # check system architecture using "uname -m"
444 # unameoutput=`uname -m 2>&1`
445 # x64str=`echo $unameoutput | grep $arch64string`
446
447 # check system architecture using "file /usr/bin/file"
448 fileoutput=`file /usr/bin/file 2>&1`
449 x64str=`echo $fileoutput | grep $arch64string2`
450
451 if [ ! -z "$x64str" ]; then
452 is_64bit_arch="yes"
453 echo "64-bit Linux"
454 fi
455}
456
424# the user might want to specify java runtime on the commandline
425USAGE="Usage: $0 [ -j <java_runtime> ]"
426while getopts hj: opt; do
427 echo "Parameter: $opt"
428 case $opt in
429 j) java_runtime_set="yes";
430 java_runtime="${OPTARG}"
431 if [ ! -f "$java_runtime" ]; then

--- 23 unchanged lines hidden (view full) ---

455
456# changing into setup directory
457cd "`dirname "$0"`"
458
459# prepare jre, if not set on command line
460if [ "$java_runtime_set" != "yes" ]; then
461 platform=`uname -s`
462 if [ "`uname -s`" = "Linux" ]; then
457# the user might want to specify java runtime on the commandline
458USAGE="Usage: $0 [ -j <java_runtime> ]"
459while getopts hj: opt; do
460 echo "Parameter: $opt"
461 case $opt in
462 j) java_runtime_set="yes";
463 java_runtime="${OPTARG}"
464 if [ ! -f "$java_runtime" ]; then

--- 23 unchanged lines hidden (view full) ---

488
489# changing into setup directory
490cd "`dirname "$0"`"
491
492# prepare jre, if not set on command line
493if [ "$java_runtime_set" != "yes" ]; then
494 platform=`uname -s`
495 if [ "`uname -s`" = "Linux" ]; then
463 install_linux_rpm
496 check_64bit_architecture
497 if [ "$is_64bit_arch" = "no" ]; then
498 install_linux_rpm
499 else
500 find_jre_in_path
501 if [ "$java_runtime_found" = "yes" ]; then
502 check_linux_jre_version
503 if [ ! "$java_runtime_sufficient" = "yes" ]; then
504 errortext="Error: Did not find a valid Java Runtime Environment (JRE). Required JRE versions: $java_versions_supported"
505 errorcode="14"
506 do_exit
507 fi
508 else
509 errortext="Error: Did not find an installed Java Runtime Environment (JRE)."
510 errorcode="15"
511 do_exit
512 fi
513 fi
464 elif [ "`uname -s`" = "SunOS" ]; then
465 check_architecture
514 elif [ "`uname -s`" = "SunOS" ]; then
515 check_architecture
466 find_solaris_jre
516 find_jre_in_path
467 if [ "$java_runtime_found" = "yes" ]; then
468 check_jre_version
469 if [ ! "$java_runtime_sufficient" = "yes" ]; then
470 errortext="Error: Did not find a valid Java Runtime Environment (JRE). Required JRE versions: $java_versions_supported"
471 errorcode="9"
472 do_exit
473 fi
474 else

--- 24 unchanged lines hidden ---
517 if [ "$java_runtime_found" = "yes" ]; then
518 check_jre_version
519 if [ ! "$java_runtime_sufficient" = "yes" ]; then
520 errortext="Error: Did not find a valid Java Runtime Environment (JRE). Required JRE versions: $java_versions_supported"
521 errorcode="9"
522 do_exit
523 fi
524 else

--- 24 unchanged lines hidden ---