CentOS6.5 installation and configuration JDK-7
System Environment: centos-6.5 Installation Method: rpm Installation Software: jdk-7-linux-i586.rpm: http://www.oracle.com/technetwork/java/javase/downloads/index.htmlcheck system original zookeeper root@localhost~] # Java-versionjava version "1.7.0 _ 24" OpenJDK Runtime Environment (build 1.7.0 _ 24-b18) OpenJDK HotSpot (TM)ClientRun VM (build 24.45-b08, mixed mode, sharing) to view the JDK information: [root @ localhost ~] # Rpm-qa | grep javatzdata-java-2012c-1.el6.noarchjava-1.7.0-openjdk-1.7.0.45-1.45.1.11.1.el6.x86_64 uninstall OpenJDK and perform the following operations: [root @ localhost~] # Rpm-e -- nodeps tzdata-java-2012c-1.el6.noarch [root @ localhost~] # Rpm-e -- nodeps java-1.7.0-openjdk-1.7.0.45-1.45.1.11.1.el6.x86_64 install JDK upload new jdk-7-linux-i586.rpm software to/usr/local/perform the following operations: [root @ localhost ckb] # rpm-ivh jdk-7-linux-i586.rpmJDK is installed in/usr/java by default. Verify the installation and perform the following operations to check whether the information is normal: [root @ localhostBin] # java [root @ localhostBin] # javac [root @ localhostBin] # java-versionjava version "1.7.0 _ 45" Java (TM) SE Runtime Environment (build 1.7.0 _ 45-b18) Java HotSpot (TM) Client VM (build 24.45-b08, mixed mode, sharing) Configure environment variables my machine after installing the jdk-7-linux-i586.rpm without configuring environment variables can also be normal to perform javac, java-version operations, so I did not configure JDK environment variables. However, for future discomfort, we should record how to configure it as follows: modify the system environment variable file vi +/etc/profile and append the following content to the file: JAVA_HOME =/usr/java/jdk1.7.0 _ 45JRE_HOME =/usr/java/jdk1.7.0 _ 45/jrePATH = $ PATH: $ JAVA_HOME/bin: $ JRE_HOME/binCLASSPATH =: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar: $ JRE_HOME/libexport JAVA_HOME JRE_HOME path classpath to make the modification take effect [root @ localhost ~] # Source/etc/profile// Make the modification take effect immediately [root @ localhost ~] # Echo $ PATH// View the PATH value to view the system environment status [root @ localhost ~] # Echo $ PATH/usr/lib/qt-3.3/bin:/usr/local/sbin:/usr/sbin: /sbin:/usr/java/jdk1.7.0 _ 45/bin:/usr/java/jdk1.7.0 _ 45/jre/bin:/home/ckb/bin