瀏覽代碼

Create /usr/lib/jvm at the right place

Rather than using an include to modify the path when the main installer resumes, create a symlink to the newly installed java binary and use that


git-svn-id: http://svn.dmdirc.com/trunk@4243 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Shane Mc Cormack 16 年之前
父節點
當前提交
e5615b25ea
共有 2 個檔案被更改,包括 16 行新增12 行删除
  1. 11
    8
      installer/linux/installjre.sh
  2. 5
    4
      installer/linux/setup.sh

+ 11
- 8
installer/linux/installjre.sh 查看文件

@@ -179,6 +179,7 @@ if [ $? -eq 0 ]; then
179 179
 		UID=`id -u`;
180 180
 	fi
181 181
 	if [ "0" = "${UID}" ]; then
182
+		mkdir -p /usr/lib/jvm/
182 183
 		installdir=/usr/lib/jvm/${JREJAVAHOME}
183 184
 	else
184 185
 		installdir=${HOME}/${JREJAVAHOME}
@@ -217,20 +218,23 @@ if [ $? -eq 0 ]; then
217 218
 		mv ${JREJAVAHOME} ${installdir}
218 219
 		
219 220
 		if [ "0" = "${UID}" ]; then
220
-			mkdir -p /usr/lib/jvm/
221
-			
222 221
 			# Add to global path.
223 222
 			if [ -e "/usr/bin/java" ]; then
224 223
 				rm -Rf /usr/bin/java
225 224
 			fi;
226 225
 			ln -s /usr/lib/jvm/${JREJAVAHOME}/bin/java /usr/bin/java
226
+			
227
+			# This allows the main installer to continue with the new java version,
228
+			# incase the shell doesn't find the new binary.
229
+			echo "Adding java-bin: ${installdir}/bin/java -> ${PWD}/java-bin"
230
+			ln -s ${installdir}/bin/java ${PWD}/java-bin
227 231
 		else
228 232
 			# Add to path.
229 233
 			if [ -e ${HOME}/.profile ]; then
230 234
 				echo "" >> ${HOME}/.profile
231 235
 				echo "# set PATH so it includes user's private java if it exists" >> ${HOME}/.profile
232 236
 				echo "if [ -d ~/${JREJAVAHOME}/bin ] ; then" >> ${HOME}/.profile
233
-				echo "	PATH=~/${JREJAVAHOME}/bin:\"\${PATH}\"" >> ${HOME}/.profile
237
+				echo "	PATH=~/${JREJAVAHOME}/bin:\${PATH}" >> ${HOME}/.profile
234 238
 				echo "fi" >> ${HOME}/.profile
235 239
 			fi
236 240
 			if [ -e ${HOME}/.cshrc ]; then
@@ -241,9 +245,9 @@ if [ $? -eq 0 ]; then
241 245
 				echo "endfi" >> ${HOME}/.cshrc
242 246
 			fi
243 247
 			
244
-			echo "Adding JREPath: ${PWD}/jrepath"
245 248
 			# This allows the main installer to continue with the new java version.
246
-			echo "export PATH=~/${JREJAVAHOME}/bin:\"\${PATH}\"" > ${PWD}/jrepath
249
+			echo "Adding java-bin: ${installdir}/bin/java -> ${PWD}/java-bin"
250
+			ln -s ${installdir}/bin/java ${PWD}/java-bin
247 251
 			
248 252
 			# This allows dmdirc launcher to find the jre if the path is not set.
249 253
 			ln -sf ${installdir} ${HOME}/jre
@@ -253,9 +257,8 @@ if [ $? -eq 0 ]; then
253 257
 		exit 0;
254 258
 	else
255 259
 		messagedialog "Java Install" "An existing install was found at ${installdir}, but this directory is not in the current path, DMDirc setup will try to use this version of java for the install."
256
-		echo "Adding JREPath: ${PWD}/jrepath"
257
-		# This allows the main installer to continue with the new java version.
258
-		echo "export PATH=~/${JREJAVAHOME}/bin:\"\${PATH}\"" > ${PWD}/jrepath
260
+		echo "Adding java-bin: ${installdir}/bin/java -> ${PWD}/java-bin"
261
+		ln -s ${installdir}/bin/java ${PWD}/java-bin
259 262
 		exit 0;
260 263
 	fi;
261 264
 else

+ 5
- 4
installer/linux/setup.sh 查看文件

@@ -132,11 +132,12 @@ installjre() {
132 132
 		fi;
133 133
 		exit 1;
134 134
 	else
135
-		if [ -e "${PWD}/jrepath" ]; then
136
-			echo "Found JREPath: ${PWD}/jrepath"
137
-			. ${PWD}/jrepath
135
+		if [ -e "${PWD}/java-bin" ]; then
136
+			echo "Found JREBin: ${PWD}/java-bin"
137
+			JAVA="${PWD}/java-bin"
138
+		else
139
+			JAVA=`which java`
138 140
 		fi;
139
-		JAVA=`which java`
140 141
 	fi;
141 142
 }
142 143
 

Loading…
取消
儲存