Ubuntu10.4 install jdk1.6

2 篇文章 0 订阅
2 篇文章 0 订阅

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

ls
 

    to scan the file list.

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

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 :

sudo gedit /etc/environment
 

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

sudo vi /etc/environment
 

    Add the following lines in the end of file.

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 :

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 :

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:

sudo update-alternatives --config java  to 

 

    Tips: sudo update-alternatives -- install is used to change the priority.
 
OK!Now you can enter

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值