日期:2014-05-16  浏览次数:20750 次

linux下安装jdk

1.从

http://download.oracle.com/auth/otn-pub/java/jdk/6u26-b03/jdk-6u26-linux-i586-rpm.bin?e=1309006712&h=b2c67cc1270074c03795ebb174231140

下载JDK

?

2.修改文件,添加执行的权限

chmod -x jdk-6u26-linux-i586-rpm.bin

?

3.运行

./jdk-6u26-linux-i586-rpm.bin

可以看到解压信息

?

?

Unpacking...
Checksumming...
Extracting...
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu).
  inflating: jdk-6u26-linux-i586.rpm  
  inflating: sun-javadb-common-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-core-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-client-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-demo-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-docs-10.6.2-1.1.i386.rpm  ^[^A
  inflating: sun-javadb-javadoc-10.6.2-1.1.i386.rpm  
Preparing...                ########################################### [100%]
   1:jdk                    ########################################### [100%]
Unpacking JAR files...
        rt.jar...
        jsse.jar...
        charsets.jar...
        tools.jar...
        localedata.jar...
        plugin.jar...
        javaws.jar...
        deploy.jar...
Installing JavaDB
Preparing...                ########################################### [100%]
   1:sun-javadb-common      ########################################### [ 17%]
   2:sun-javadb-core        ########################################### [ 33%]
   3:sun-javadb-client      ########################################### [ 50%]
   4:sun-javadb-demo        ########################################### [ 67%]
   5:sun-javadb-docs        ########################################### [ 83%]
   6:sun-javadb-javadoc     ########################################### [100%]

Java(TM) SE Development Kit 6 successfully installed.

Product Registration is FREE and includes many benefits:
* Notification of new versions, patches, and updates
* Special offers on Oracle products, services and training
* Access to early releases and documentation

Product and system data will be collected. If your configuration
supports a browser, the JDK Product Registration form will
be presented. If you do not register, none of this information
will be saved. You may also register your JDK later by
opening the register.html file (located in the JDK installation
directory) in a browser.

For more information on what data Registration collects and 
how it is managed and used, see:
http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html

Press Enter to continue.....

?可以看到

?

jdk-6u26-linux-i586.rpm

sun-javadb-client-10.6.2-1.1.i386.rpm
sun-javadb-common-10.6.2-1.1.i386.rpm
sun-javadb-core-10.6.2-1.1.i386.rpm
sun-javadb-demo-10.6.2-1.1.i386.rpm
sun-javadb-docs-10.6.2-1.1.i386.rpm
sun-javadb-javadoc-10.6.2-1.1.i386.rpm
这几个文件

4.安装jdk-6u26-linux-i586.rpm
rpm -ivh jdk-6u26-linux-i586.rpm

5.配置JAVA_HOME
vi /etc/profile

添加(vi操作:进入编辑模式i,保存退出wq)
JAVA_HOME=/usr/java/jdk1.6.0_26
PATH
=$JAVA_HOME/bin:$PATH
CLASSPATH
=.:$JAVA_HOME/lib/