Created
November 11, 2011 02:01
-
-
Save tankchintan/1356939 to your computer and use it in GitHub Desktop.
Revisions
-
tankchintan renamed this gist
Nov 11, 2011 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
tankchintan created this gist
Nov 11, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ # To be put in /etc/rc.d/rc.local bash /home/ec2-user/misc/java-version-changer.sh >> /home/ec2-user/misc/java-change.log 2>&1 # Contents of java-version-changer.sh that detects if openJDK is installed, if true first it will # install sun jdl & then set it as the default Java SDK dd="`date +%Y_%m_%d__%H_%M_%S`" if [ `ls -l /etc/alternatives/java | grep openjdk | wc -l` -eq 1 ]; then echo "$dd - Open JDK" sudo /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_01/bin/java 20000 sudo /usr/sbin/alternatives --set java /usr/java/jdk1.7.0_01/bin/java echo "$dd - Changed to Sun JDK" else echo "$dd - Sun JDK" fi