Revision 39412 branches/v2_0_0_prep/build/product/gvSIG.sh
gvSIG.sh | ||
---|---|---|
6 | 6 |
########################################### |
7 | 7 |
|
8 | 8 |
set -e |
9 |
#set -x |
|
9 | 10 |
|
10 |
# Java home |
|
11 |
export JAVA_HOME=${JAVA_HOME} |
|
12 |
if [ "$JAVA_HOME" = "" ] ; then |
|
13 |
JAVA="java" |
|
11 |
if type which >/dev/null; then |
|
12 |
WHICH=which |
|
14 | 13 |
else |
15 |
JAVA="$JAVA_HOME/bin/java"
|
|
14 |
WHICH=type
|
|
16 | 15 |
fi |
17 | 16 |
|
17 |
FORCE_JAVA_32BITS="" |
|
18 |
JAVA_HOME_OTHER_ARCHITECTURE="" |
|
19 |
PRIVATE_JAVA_HOME="$HOME/gvSIG/jre/*1.6* $HOME/gvSIG/jre/*1.5*" |
|
20 |
# |
|
21 |
# in next line, JAVA_HOME is set during instalation process |
|
22 |
DEFAULT_JAVA_HOME="${JAVA_HOME}" |
|
23 |
# |
|
24 |
# |
|
25 |
# Try to use java from: |
|
26 |
# 1. Java specified in JAVA_HOME variable |
|
27 |
# 2. Java specified in the instalation process |
|
28 |
# 3. Java in the HOME/gvsig/jre folder (optionally created during installation process) |
|
29 |
# 4. Java in the system path. |
|
30 |
# |
|
31 |
for JAVA_HOME_TO_USE in "$JAVA_HOME" "$DEFAULT_JAVA_HOME" $PRIVATE_JAVA_HOME "" |
|
32 |
do |
|
33 |
if [ "$JAVA_HOME_TO_USE" = "" ] ; then |
|
34 |
continue |
|
35 |
fi |
|
36 |
if [ ! -d "$JAVA_HOME_TO_USE" ] ; then |
|
37 |
echo "WARNING: Incorrect JAVA_HOME ($JAVA_HOME_TO_USE), skip" |
|
38 |
continue |
|
39 |
fi |
|
40 |
if [ ! -x "$JAVA_HOME_TO_USE/bin/java" ] ; then |
|
41 |
echo "WARNING: Incorrect JAVA_HOME ($JAVA_HOME_TO_USE), bin/java not found, skip" |
|
42 |
continue |
|
43 |
fi |
|
44 |
if ! "$JAVA_HOME_TO_USE/bin/java" -d32 -version 2>/dev/null ; then |
|
45 |
JAVA_HOME_OTHER_ARCHITECTURE="$JAVA_HOME_TO_USE" |
|
46 |
echo "WARNING: java 32 bits not found in $JAVA_HOME_TO_USE, skip" |
|
47 |
continue |
|
48 |
fi |
|
49 |
break |
|
50 |
done |
|
51 |
if [ "$JAVA_HOME_TO_USE" = "" ] ; then |
|
52 |
# Try to use the java in the system path |
|
53 |
if ! type java >/dev/null ; then |
|
54 |
# java not found in the system path |
|
55 |
if [ "$JAVA_HOME_OTHER_ARCHITECTURE" != "" ] ; then |
|
56 |
FORCE_JAVA_32BITS="" |
|
57 |
JAVA_HOME="$JAVA_HOME_OTHER_ARCHITECTURE" |
|
58 |
JAVA="$JAVA_HOME/bin/java" |
|
59 |
echo "WARNING: java 32 bits not found in the system path, using $JAVA_HOME_OTHER_ARCHITECTURE" |
|
60 |
else |
|
61 |
echo "WARNING: java not found in the system" |
|
62 |
exit 1 |
|
63 |
fi |
|
64 |
else |
|
65 |
if ! java -d32 -version 2>/dev/null ; then |
|
66 |
FORCE_JAVA_32BITS="" |
|
67 |
echo "WARNING: java 32 bits not found, using $($WHICH java)" |
|
68 |
else |
|
69 |
FORCE_JAVA_32BITS="-d32" |
|
70 |
fi |
|
71 |
unset JAVA_HOME |
|
72 |
JAVA="java" |
|
73 |
fi |
|
74 |
else |
|
75 |
JAVA_HOME="$JAVA_HOME_TO_USE" |
|
76 |
JAVA="$JAVA_HOME/bin/java" |
|
77 |
FORCE_JAVA_32BITS="-d32" |
|
78 |
fi |
|
79 |
echo "Using java $($WHICH $JAVA)" |
|
80 |
export JAVA_HOME |
|
81 |
export JAVA |
|
18 | 82 |
|
19 | 83 |
# Go into the gvSIG installation folder, just in case |
20 | 84 |
cd `dirname "$0"` |
... | ... | |
83 | 147 |
# http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html |
84 | 148 |
|
85 | 149 |
echo Launching gvSIG: ${JAVA} \ |
150 |
$FORCE_JAVA_32BITS \ |
|
86 | 151 |
-Djava.library.path=/usr/lib:"${GVSIG_NATIVE_LIBS}" \ |
87 | 152 |
-cp $GVSIG_CLASSPATH \ |
88 | 153 |
-Xms${GVSIG_INITIAL_MEM} \ |
... | ... | |
91 | 156 |
$GVSIG_LAUNCHER $GVSIG_PARAMS |
92 | 157 |
|
93 | 158 |
${JAVA} \ |
159 |
$FORCE_JAVA_32BITS \ |
|
94 | 160 |
-Djava.library.path=/usr/lib:"${GVSIG_NATIVE_LIBS}" \ |
95 | 161 |
-cp $GVSIG_CLASSPATH \ |
96 | 162 |
-Xms${GVSIG_INITIAL_MEM} \ |
97 | 163 |
-Xmx${GVSIG_MAX_MEM} \ |
98 | 164 |
-XX:MaxPermSize=${GVSIG_MAX_PERM_SIZE} \ |
99 | 165 |
$GVSIG_LAUNCHER $GVSIG_PARAMS |
166 |
|
Also available in: Unified diff