Posted by : 小p 30 11月 2011

1、抓取 JDK 7
    http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-i586.tar.gz
    或是可於終端機下輸入
    wget -c http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-i586.tar.gz



 2、解壓縮:
    將jdk-7-linux-i586.tar.gz 複製到/home/[userid] 裡面
    將解壓縮後的JDK放置於/usr/lib/jvm,終端機下輸入
    cd /usr/lib
    sudo mkdir jvm
    cd /home/[userid]
    sudo tar zxvf ./jdk-7-linux-i586.tar.gz -C /usr/lib/jvm
    更名為sun-java-7
    cd /usr/lib/jvm
    sudo mv jdk1.7.0/ sun-java-7

3、修改環境變數:
    將相關路徑參數添加入~/.bashrc檔案中
    vi ~/.bashrc  
    export JAVA_HOME=/usr/lib/jvm/sun-java-7
    export JRE_HOME=${JAVA_HOME}/jre
    export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
    export PATH=${JAVA_HOME}/bin:$PATH

4、更新設定檔:
    source ~/.bashrc

5、確認是否有更新:
      java -version

     出現下列資訊即表示安裝成功
     java version "1.7.0"
     Java(TM) SE Runtime Environment (build 1.7.0-b147)
     Java HotSpot(TM) Server VM (build 21.0-b17, mixed mode)

  

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Welcome to My Blog

CATEGORIES

Archives

小Pの日本旅遊經驗值

Popular Posts

Bloggerads

- Copyright © 一期一會 -Robotic Notes- Powered by Blogger - Designed by Johanes Djogan -