Software version: jdk-8u20-linux-x64.rpm
:
Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4B/5E/wKiom1QquCSz_d1JAAdJ-iGA1UE650.jpg "title=" Java SE Development Kit 8u20.jpg "alt=" Wkiom1qqucsz_d1jaadj-iga1ue650.jpg "/>
(1), find the package of OPENJDK
[Email protected] ~]# Rpm-qa | grep Javajava-1.6.0-openjdk-1.6.0.0-1.50.1.11.5.el6_3.x86_64tzdata-java-2012j-1.el6.noarchjava_ Cup-0.10k-5.el6.x86_64java-1.7.0-openjdk-1.7.0.9-2.3.4.1.el6_3.x86_64java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_ 64gcc-java-4.4.7-3.el6.x86_64
(2), check the version of OPENJDK
[Email protected] ~]# Java-versionjava version "1.7.0_09-icedtea" OpenJDK Runtime Environment (rhel-2.3.4.1.el6_3-x86_ OpenJDK 64-bit Server VM (build 23.2-b09, Mixed mode) [[email protected] ~]#
(3), uninstall OPENJDK
[Email protected] ~]# rpm-e--nodeps java-1.6.0-openjdk-1.6.0.0-1.50.1.11.5.el6_3.x86_64[[email protected] ~]# rpm-e- -nodeps Tzdata-java-2012j-1.el6.noarch[[email protected] ~]# rpm-e--nodeps java_cup-0.10k-5.el6.x86_64[[email Protected] ~]# rpm-e--nodeps java-1.7.0-openjdk-1.7.0.9-2.3.4.1.el6_3.x86_64[[email protected] ~]# rpm-e--nodeps java -1.5.0-gcj-1.5.0.0-29.1.el6.x86_64[[email protected] ~]# rpm-e--nodeps gcc-java-4.4.7-3.el6.x86_64
(4), installation jdk-8u20-linux-x64.rpm
[Email protected] downloads]# RPM-IVH jdk-8u20-linux-x64.rpm Preparing ... ############################### ############ [100%] 1:jdk1.8.0_20 ########################################### [100%]unpacking JAR files ... Rt.jar ... jsse.jar ... charsets.jar ... tools.jar localedata.jar ... jfxrt.jar...[-... [Email protected] downloads]#
(5), configure environment variables
[email protected] jdk1.8.0_20]# cat << EOF >>/etc/profile> java_home=/usr/java/jdk1.8.0_20> jre_ Home=/usr/java/jdk1.8.0_20/jre> path= $PATH: $JAVA _home/bin: $JRE _home/bin> classpath=.: $JAVA _home/lib/dt.jar : $JAVA _home/lib/tools.jar: $JRE _home/lib> export java_home jre_home PATH classpath> eof[[email protected] jdk1.8.0_20]#
Make the environment variable effective immediately:
[Email protected] jdk1.8.0_20]# Source/etc/profile
(6), test the installation is successful
[[email protected] jdk1.8.0_20]# java[[email protected] jdk1.8.0_20]# Java-version[[email protected] jdk1.8.0_20]# Javac
Details are as follows:
[[Email protected] jdk1.8.0_20]# java
Usage:java [-options] class [args ...]
(to execute a class)
or Java [-options]-jar jarfile [args ...]
(To execute a jar file)
Where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "Server" VM
The default VM is server.
-CP <class Search Path of directories and Zip/jar files>
-classpath <class Search Path of directories and Zip/jar files>
a:separated List of directories, JAR archives,
and ZIP archives to search for class files.
-d<name>=<value>
Set a system property
-VERBOSE:[CLASS|GC|JNI]
Enable verbose output
-version Print product version and exit
-version:<value>
Require the specified version to run
-showversion Print product version and continue
-jre-restrict-search | -no-jre-restrict-search
Include/exclude user Private JREs in the version search
-? -help Print this Help message
-X Print Help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
Enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
Disable assertions with specified granularity
-esa | -enablesystemassertions
Enable System assertions
-DSA | -disablesystemassertions
Disable System assertions
-agentlib:<libname>[=<options>]
Load native Agent library <libname>, e.g.-agentlib:hprof
See Also,-agentlib:jdwp=help and-agentlib:hprof=help
-agentpath:<pathname>[=<options>]
Load native Agent library by full pathname
-javaagent:<jarpath>[=<options>]
Load Java programming language agent, see Java.lang.instrument
-splash:<imagepath>
Show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
[Email protected] jdk1.8.0_20]# java-version
Java Version "1.8.0_20"
Java (TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot (TM) 64-bit Server VM (build 25.20-b23, Mixed mode)
[Email protected] jdk1.8.0_20]# Javac
Usage:javac <options> <source files>
Where possible options include:
-G Generate All debugging Info
-g:none Generate No debugging Info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate No warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-classpath <path> specify where to find user class files and annotation processors
-CP <path> specify where to find user class files and annotation processors
-sourcepath <path> specify where to find input source files
-bootclasspath <path> Override Location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-endorseddirs <dirs> Override location of endorsed standards path
-proc:{none,only} Control whether annotation processing and/or compilation is done.
-processor <class1>[,<class2>,<class3> ...] Names of the annotation processors to run; Bypasses default discovery process
-processorpath <path> specify where to find annotation processors
-parameters Generate metadata for reflection on method parameters
-D <directory> specify where to place generated class files
-S <directory> specify where to place generated source files
-h <directory> specify where to place generated native header files
-implicit:{none,class} Specify whether or not to generate class files for implicitly referenced files
-encoding <encoding> Specify character encoding used by source files
-source <release> provide source compatibility with specified release
-target <release> Generate class files for specific VM version
-profile <profile> Check that API used are available in the specified profile
-version Version Information
-help Print A synopsis of standard options
-akey[=value] Options to pass to annotation processors
-X Print A synopsis of nonstandard options
-j<flag> Pass <flag> directly to the runtime system
-werror Terminate Compilation If warnings occur
@<filename> Read options and filenames from file
This article is from "Jerry" blog, please make sure to keep this source http://alipay.blog.51cto.com/7119970/1560188
Installing jdk-8u20-linux-x64 in centos-6.4-x86_64