Lines 15-22
Link Here
|
15 |
# Normally, editing this script should not be required. |
15 |
# Normally, editing this script should not be required. |
16 |
# ----------------------------------------------------- |
16 |
# ----------------------------------------------------- |
17 |
|
17 |
|
18 |
# use $JDK_HOME or $NB_JDK_HOME or the -jdkhome switch, do not edit this here |
18 |
# use $JDK_HOME or the -jdkhome switch, do not edit this here |
19 |
# (see below for info on .runide_defaults.sh) |
|
|
20 |
jdkhome="" |
19 |
jdkhome="" |
21 |
|
20 |
|
22 |
# append on command line or ide.cfg, with -J prefix on each |
21 |
# append on command line or ide.cfg, with -J prefix on each |
Lines 47-67
Link Here
|
47 |
|
46 |
|
48 |
oldpwd=`pwd` ; cd "${idehome}"; idehome=`pwd`; cd "${oldpwd}"; unset oldpwd |
47 |
oldpwd=`pwd` ; cd "${idehome}"; idehome=`pwd`; cd "${oldpwd}"; unset oldpwd |
49 |
|
48 |
|
50 |
# calculate branding to brand userdir with |
|
|
51 |
defaults="$idehome/bin/.runide_defaults.sh" |
52 |
if [ -r "$idehome/lib/branding" ]; then |
53 |
branding=`cat "$idehome/lib/branding"` |
54 |
if [ -r "$idehome/bin/.runide_defaults_$branding.sh" ]; then |
55 |
defaults="$idehome/bin/.runide_defaults_$branding.sh" |
56 |
fi |
57 |
fi |
58 |
# This script should set the var userdir at the least: |
59 |
# (another likely option would be $jdkhome, see #18628) |
60 |
. "$defaults" |
61 |
|
62 |
jargs=${jreflags} |
49 |
jargs=${jreflags} |
63 |
jargs="$jargs -Dnetbeans.home=\"$idehome\"" |
50 |
jargs="$jargs -Dnetbeans.home=\"$idehome\"" |
64 |
jargs="$jargs -Djava.security.policy=\"$idehome/bin/ide.policy\"" |
51 |
jargs="$jargs -Djava.security.policy=\"$idehome/launcher/security.policy\"" |
65 |
|
52 |
|
66 |
args="" |
53 |
args="" |
67 |
|
54 |
|
Lines 87-92
Link Here
|
87 |
jdkhome="$JAVA_PATH" |
74 |
jdkhome="$JAVA_PATH" |
88 |
fi |
75 |
fi |
89 |
|
76 |
|
|
|
77 |
if [ ! -z "$NB_PATH" ]; then |
78 |
nbpath="$NB_PATH" |
79 |
else |
80 |
nbpath="$progdir/../.." |
81 |
fi |
82 |
|
83 |
# default value for dirs argument, starts only platform |
84 |
nbdirs=platform* |
85 |
|
90 |
# |
86 |
# |
91 |
# parse arguments |
87 |
# parse arguments |
92 |
# |
88 |
# |
Lines 130-136
Link Here
|
130 |
prefixcp=$prefixcp$1; |
126 |
prefixcp=$prefixcp$1; |
131 |
fi |
127 |
fi |
132 |
;; |
128 |
;; |
133 |
|
129 |
--dirs) |
|
|
130 |
shift; |
131 |
if [ $# -gt 0 ] ; then |
132 |
nbdirs="$1" |
133 |
fi |
134 |
;; |
134 |
-J*) jopt=`expr "X-$1" : 'X--J\(.*\)'`; jargs="$jargs \"$jopt\"";; |
135 |
-J*) jopt=`expr "X-$1" : 'X--J\(.*\)'`; jargs="$jargs \"$jopt\"";; |
135 |
*) args="$args \"$1\"" ;; |
136 |
*) args="$args \"$1\"" ;; |
136 |
esac |
137 |
esac |
Lines 138-150
Link Here
|
138 |
done |
139 |
done |
139 |
} # parse_args() |
140 |
} # parse_args() |
140 |
|
141 |
|
141 |
# Process any ./ide.cfg or ~/ide.cfg. |
142 |
# Process any system config |
|
|
143 |
# Note that there is no quoting scheme for these files. |
144 |
if [ -r "${NB_CONFIG_SYSTEM}" ]; then |
145 |
parse_args `cat "${NB_CONFIG_SYSTEM}"` |
146 |
fi |
147 |
|
148 |
# Process user config |
142 |
# Note that there is no quoting scheme for these files. |
149 |
# Note that there is no quoting scheme for these files. |
143 |
if [ -r "${HOME}/ide.cfg" ]; then |
150 |
if [ -r "${NB_CONFIG_USER}" ]; then |
144 |
parse_args `cat "${HOME}"/ide.cfg` |
151 |
parse_args `cat "${NB_CONFIG_USER}"` |
145 |
elif [ -r "${progdir}/ide.cfg" ]; then |
|
|
146 |
parse_args `cat "${progdir}"/ide.cfg` |
147 |
# else leave as is |
148 |
fi |
152 |
fi |
149 |
|
153 |
|
150 |
if [ -f /usr/j2se/opt/javahelp/lib/jhall.jar ]; then |
154 |
if [ -f /usr/j2se/opt/javahelp/lib/jhall.jar ]; then |
Lines 156-161
Link Here
|
156 |
# Process arguments given on the command line. |
160 |
# Process arguments given on the command line. |
157 |
parse_args "$@" |
161 |
parse_args "$@" |
158 |
|
162 |
|
|
|
163 |
|
164 |
resolvedirs() { |
165 |
# iterate thru $2 == $nbdirs to find them |
166 |
SEP="" |
167 |
echo $nbdirs | tr ':' '\n' | while read CLUSTER; do |
168 |
# iterate thru $1 == $nbpath |
169 |
FOUND=`echo $nbpath | tr ':' '\n' | while read DIR; do |
170 |
if [ -d "$CLUSTER" ]; then |
171 |
echo $CLUSTER |
172 |
else |
173 |
ls -d "$DIR"/$CLUSTER 2>/dev/null |
174 |
fi |
175 |
done | sort -u -r` |
176 |
|
177 |
if [ -z "$FOUND" ]; then |
178 |
echo Cannot found directory \"$CLUSTER\" in search locations \"$nbpath\" |
179 |
exit 2 |
180 |
fi |
181 |
|
182 |
echo -n "$SEP" |
183 |
echo -n "$FOUND" |
184 |
SEP=":" |
185 |
done |
186 |
} # end of resolvedirs |
187 |
|
188 |
dirsresult=`resolvedirs \"$nbpath\" \"$nbdirs\"` |
189 |
exitcode=$? |
190 |
if [ "0" != "$exitcode" ]; then |
191 |
echo $dirsresult |
192 |
exit 5 |
193 |
fi |
194 |
|
195 |
jargs="$jargs -Dnetbeans.dirs=\"$dirsresult\"" |
196 |
|
197 |
|
159 |
# |
198 |
# |
160 |
# check JDK |
199 |
# check JDK |
161 |
# |
200 |
# |
Lines 177-186
Link Here
|
177 |
# check userdir |
216 |
# check userdir |
178 |
# |
217 |
# |
179 |
|
218 |
|
180 |
if [ ! -z "$userdir" ] ; then |
219 |
if [ -z "$userdir" ]; then |
181 |
args="--userdir \"${userdir}\" $args" |
220 |
if [ -z "$NB_USER_DIR" ]; then |
|
|
221 |
echo Need to specify user dir using env variable NB_USER_DIR or command line option --userdir |
222 |
exit 7 |
223 |
fi |
224 |
userdir="$NB_USER_DIR" |
182 |
fi |
225 |
fi |
183 |
|
226 |
|
|
|
227 |
args="--userdir \"${userdir}\" $args" |
228 |
|
184 |
# |
229 |
# |
185 |
# increase file descriptor's limit, on Solaris it's set to 64, too small for |
230 |
# increase file descriptor's limit, on Solaris it's set to 64, too small for |
186 |
# fastjavac |
231 |
# fastjavac |
Lines 202-209
Link Here
|
202 |
|
247 |
|
203 |
build_cp() { |
248 |
build_cp() { |
204 |
base="$1" |
249 |
base="$1" |
205 |
append_jars_to_cp "${base}/lib/ext" |
250 |
append_jars_to_cp "${base}/launcher" |
206 |
append_jars_to_cp "${base}/lib/ext/locale" |
251 |
append_jars_to_cp "${base}/launcher/locale" |
207 |
} |
252 |
} |
208 |
|
253 |
|
209 |
do_run_updater() { |
254 |
do_run_updater() { |
Lines 287-294
Link Here
|
287 |
|
332 |
|
288 |
build_cp "${idehome}" |
333 |
build_cp "${idehome}" |
289 |
|
334 |
|
290 |
if [ -f "${idehome}/lib/updater.jar" ] ; then |
335 |
if [ -f "${idehome}/boot/updater.jar" ] ; then |
291 |
updatercp="${idehome}/lib/updater.jar" |
336 |
updatercp="${idehome}/boot/updater.jar" |
292 |
fi |
337 |
fi |
293 |
|
338 |
|
294 |
# JDK tools |
339 |
# JDK tools |