zoukankan      html  css  js  c++  java
  • Ubuntu10.4 install jdk1.6

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

    Now I will introduce you how to intall jdk1.6 on Ubuntu.

    Follow me!

    One

    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.

    Two
    After file is donwloaded,we also can use command:ls to scan the file list.

    Three
    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

    Four
    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.

    Five
    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

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

    OK!Now you can enter command: java -version to test if jdk is ok.

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

     

  • 相关阅读:
    思科交换机命令
    Cisco2960 交换机密码破解方法
    洛谷 P2147 [SDOI2008]洞穴勘测
    BZOJ 4025: 二分图
    算法笔记--可撤销并查集 && 可持久化并查集
    P5043 【模板】树同构([BJOI2015]树的同构)
    算法笔记--BSGS && exBSGS 模板
    算法笔记--线性基求交模板
    AcWing 246. 区间最大公约数
    2018年长沙理工大学第十三届程序设计竞赛 I 连续区间的最大公约数
  • 原文地址:https://www.cnblogs.com/alicusblog/p/3355559.html
Copyright © 2011-2022 走看看