Browse Source

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 years ago
parent
commit
e5615b25ea
2 changed files with 16 additions and 12 deletions
  1. 11
    8
      installer/linux/installjre.sh
  2. 5
    4
      installer/linux/setup.sh

+ 11
- 8
installer/linux/installjre.sh View File

179
 		UID=`id -u`;
179
 		UID=`id -u`;
180
 	fi
180
 	fi
181
 	if [ "0" = "${UID}" ]; then
181
 	if [ "0" = "${UID}" ]; then
182
+		mkdir -p /usr/lib/jvm/
182
 		installdir=/usr/lib/jvm/${JREJAVAHOME}
183
 		installdir=/usr/lib/jvm/${JREJAVAHOME}
183
 	else
184
 	else
184
 		installdir=${HOME}/${JREJAVAHOME}
185
 		installdir=${HOME}/${JREJAVAHOME}
217
 		mv ${JREJAVAHOME} ${installdir}
218
 		mv ${JREJAVAHOME} ${installdir}
218
 		
219
 		
219
 		if [ "0" = "${UID}" ]; then
220
 		if [ "0" = "${UID}" ]; then
220
-			mkdir -p /usr/lib/jvm/
221
-			
222
 			# Add to global path.
221
 			# Add to global path.
223
 			if [ -e "/usr/bin/java" ]; then
222
 			if [ -e "/usr/bin/java" ]; then
224
 				rm -Rf /usr/bin/java
223
 				rm -Rf /usr/bin/java
225
 			fi;
224
 			fi;
226
 			ln -s /usr/lib/jvm/${JREJAVAHOME}/bin/java /usr/bin/java
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
 		else
231
 		else
228
 			# Add to path.
232
 			# Add to path.
229
 			if [ -e ${HOME}/.profile ]; then
233
 			if [ -e ${HOME}/.profile ]; then
230
 				echo "" >> ${HOME}/.profile
234
 				echo "" >> ${HOME}/.profile
231
 				echo "# set PATH so it includes user's private java if it exists" >> ${HOME}/.profile
235
 				echo "# set PATH so it includes user's private java if it exists" >> ${HOME}/.profile
232
 				echo "if [ -d ~/${JREJAVAHOME}/bin ] ; then" >> ${HOME}/.profile
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
 				echo "fi" >> ${HOME}/.profile
238
 				echo "fi" >> ${HOME}/.profile
235
 			fi
239
 			fi
236
 			if [ -e ${HOME}/.cshrc ]; then
240
 			if [ -e ${HOME}/.cshrc ]; then
241
 				echo "endfi" >> ${HOME}/.cshrc
245
 				echo "endfi" >> ${HOME}/.cshrc
242
 			fi
246
 			fi
243
 			
247
 			
244
-			echo "Adding JREPath: ${PWD}/jrepath"
245
 			# This allows the main installer to continue with the new java version.
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
 			# This allows dmdirc launcher to find the jre if the path is not set.
252
 			# This allows dmdirc launcher to find the jre if the path is not set.
249
 			ln -sf ${installdir} ${HOME}/jre
253
 			ln -sf ${installdir} ${HOME}/jre
253
 		exit 0;
257
 		exit 0;
254
 	else
258
 	else
255
 		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."
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
 		exit 0;
262
 		exit 0;
260
 	fi;
263
 	fi;
261
 else
264
 else

+ 5
- 4
installer/linux/setup.sh View File

132
 		fi;
132
 		fi;
133
 		exit 1;
133
 		exit 1;
134
 	else
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
 		fi;
140
 		fi;
139
-		JAVA=`which java`
140
 	fi;
141
 	fi;
141
 }
142
 }
142
 
143
 

Loading…
Cancel
Save