2014年2月7日 星期五

[研究] Oracle Java 6 Update 45 快速安裝程式(CentOS 6.5 x64)

[研究] Oracle Java 6 Update 45 快速安裝程式(CentOS 6.5 x64)

2014-02-07

於 2014-08-06 發現 wget 下載 java 方式變更,此篇失效了

如要手動下載
http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html

JDK6U45x86_64_Install.sh 內容如下:

#!/bin/bash

echo -e "\033[31m"
echo -e "Program : JDK6U45x64_Install.sh "
echo -e "JDK 6 Update 45 x86_64 Install Shell Script (CentOS 6.5 x86_64) "
echo -e "by Shau-Rong Lu 2014/02/07 "
echo -e "\033[0m"

cd /usr/local

if [ ! -s jdk-6u45-linux-x64.rpm ]; then
  echo "Can not find /usr/local/jdk-6u45-linux-x64.rpm"
  wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" "http://download.oracle.com/otn/java/jdk/6u45-b06/jdk-6u45-linux-x64-rpm.bin?AuthParam=1391758319_dfde8cb68079d1f0613e41269da37d91"  -O  jdk-6u45-linux-x64-rpm.bin
  #exit
fi

chmod +x jdk-6u45-linux-x64-rpm.bin
./jdk-6u45-linux-x64-rpm.bin
alternatives --install /usr/bin/java  java  /usr/java/jdk1.6.0_45/bin/java  100
alternatives --set  java /usr/java/jdk1.6.0_45/bin/java

echo

echo 'export JAVA_HOME=/usr/java/jdk1.6.0_45' >> /etc/profile
echo 'export PATH=$PATH:$JAVA_HOME/bin' >> /etc/profile
echo 'export CLASSPATH=$JAVA_HOME/jre/lib/ext:$JAVA_HOME/lib/tools.jar' >> /etc/profile

source /etc/profile

java -version
export | grep jdk


JRE6U45x86_64_Install.sh 內容如下:


#!/bin/bash

echo -e "\033[31m"
echo -e "Program : JRE6U45x64_Install.sh "
echo -e "JRE 6 Update 45 x86_64 Install Shell Script (CentOS 6.5 x86_64) "
echo -e "by Shau-Rong Lu 2014/02/07 "
echo -e "\033[0m"

cd /usr/local

if [ ! -s jre-6u45-linux-x64.rpm ]; then
  echo "Can not find /usr/local/jre-6u45-linux-x64.rpm"
  wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" "http://download.oracle.com/otn/java/jdk/6u45-b06/jre-6u45-linux-x64-rpm.bin?AuthParam=1391758249_21ba8adf18af2f0679541ad6f529b05c"  -O  jre-6u45-linux-x64-rpm.bin
  #exit
fi

chmod +x jre-6u45-linux-x64-rpm.bin
./jre-6u45-linux-x64-rpm.bin
alternatives --install /usr/bin/java  java  /usr/java/jre1.6.0_45/bin/java  100
alternatives --set  java /usr/java/jre1.6.0_45/bin/java

echo

echo 'export JAVA_HOME=/usr/java/jre1.6.0_45' >> /etc/profile
echo 'export PATH=$PATH:$JAVA_HOME/bin' >> /etc/profile
echo 'export CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/lib/ext' >> /etc/profile

source /etc/profile

java -version
export | grep jre


(完)

[研究] Oracle Java 6 Update 45 快速安裝程式(CentOS 6.5 x64)
http://shaurong.blogspot.com/2014/02/oracle-java-6-update-45-centos-65-x64.html

[研究] Oracle Java 7 Update 51 快速安裝程式(CentOS 6.5 x64)
http://shaurong.blogspot.com/2014/01/oracle-java-7-update-51-centos-65-x64.html
http://forum.icst.org.tw/phpbb/viewtopic.php?f=44&t=80711

[研究] Oracle Java 手動安裝與快速安裝程式 (CentOS 6.5 x64)
http://shaurong.blogspot.tw/2013/12/oracle-java-centos-65-x64.html

[研究] Java 6 , 7 安裝差異+選擇切換研究 (CentOS 6.4 x64)
http://shaurong.blogspot.tw/2013/11/java-7-centos-64-x64.html

[研究] 用 wget 下載 Java 方法
http://shaurong.blogspot.tw/2013/12/wget-java.html

沒有留言:

張貼留言