Ubuntu10.4 install jdk1.6

          You know,If you want to develop java applications ,you’d better install jdk.

          Today,I will introduce you how to intall jdk1.6 on Ubuntu.Just follow me step by step.

          First step
          you should download jdk file from sun offcial website,
          URL: http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u29-download-513648.html (fixed)

          fileName : jdk-6u29-linux-i586.bin
          Tips: 1)Before you will download this file ,you should accept license agreement.
          2)If your system is Ubuntu10.4 or other 32-bit system,you can’t download the  jdk-6u29-linux-x64.bin.When you use sudo sh jdk-6u29-linux-x64.bin,it will create a file that file’s name is invalid encoding.

          Second step
          after file is donwloaded,we also can use command
          shell代碼:

              ls

          to scan the file list.

          Third step
          OK,now we can install jdk,write command :
          shell代碼:

              sudo sh jdk-6u29-linux-i586.bin

          A few miniutes later,you will be asked to press Enter key,Just do, You will see ‘Done’.
          Ok,Now jdk has been instaled by us,next step we will config environment variables for java

          Fourth step
          enter the command :
          Shell 代碼:

              sudo gedit /etc/environment

          if you are similar with vim,you can use the command :
          Shell 代碼:

              sudo vi /etc/environment

          Add the following lines in the end of file.
          Shell 代碼:

              export JAVA_HOME=/home/alicus/Downloads/jdk1.6.0_29
              export JRE_Home=>/home/alicus/Downloads/jdk1.6.0_29/jre
              export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib

          then enter command :
          Shell 代碼:

              source ~/.bashrc

          it makes the changes effective

          Fifth Step
          You should know Ubuntu10.4 make the openjdk as its default jdk ,so we should make sun jdk to be
          the default one,just use following commands :
          Shell 代碼:

              sudo update-alternatives –install /usr/bin/java java /home/alicus/Downloads/jdk1.6.0_29/bin/java 300
              sudo update-alternatives –install /usr/bin/java java /home/alicus/Downloads/jdk1.6.0_29/bin/javac 300

          use following command to scan the jdk priority:
          Shell 代碼:

              sudo update-alternatives –config java 

          Tips: sudo update-alternatives — install is used to change the priority.

          OK!Now you can enter
          Shell 代碼:

              java -version

          to test if jdk is ok.

          If you can see java version “1.6.0_29″,Congratulations!!

          If you have any questions,just contact me.
          Email:alicus890824@gmail.com

          posted on 2012-10-18 21:58 Alicus 閱讀(445) 評論(1)  編輯  收藏

          評論

          # re: Ubuntu10.4 install jdk1.6[未登錄] 2012-11-10 13:32 Andy

          Good,it is helpful!  回復  更多評論   


          只有注冊用戶登錄后才能發表評論。


          網站導航:
          博客園   IT新聞   Chat2DB   C++博客   博問  
           
          <2012年10月>
          30123456
          78910111213
          14151617181920
          21222324252627
          28293031123
          45678910

          導航

          統計

          常用鏈接

          留言簿

          隨筆分類

          隨筆檔案

          文章分類

          相冊

          Organization

          Personal

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 绥宁县| 工布江达县| 潼关县| 全椒县| 上蔡县| 桐柏县| 额尔古纳市| 乌兰县| 昭平县| 大兴区| 上饶市| 华宁县| 兰坪| 睢宁县| 佛冈县| 柏乡县| 安吉县| 麻阳| 芜湖市| 德格县| 晴隆县| 彭阳县| 芒康县| 纳雍县| 四川省| 岗巴县| 宾阳县| 诸暨市| 明星| 哈密市| 古丈县| 巴林右旗| 股票| 洛扎县| 七台河市| 天等县| 灵石县| 阳谷县| 平安县| 临邑县| 越西县|