Install JDK in linux and JDK in linux
Download the corresponding system JDK, which is generally at the end of .tar.gz;
1.1 install Dependencies
Yum install glibc. i686
Yum-y install libaio. so.1 libgcc_s.so.1 libstdc ++. so.6
Yum update libstdc ++-4.4.7-4. el6.x86 _ 64
Yum install gcc-c ++
1.2 check whether jdk software has been installed before the system. If jdk software has been installed, uninstall it.
Rpm-qa | grep-I jdk
Description of parameters: q indicates that query a indicates all | MPs queue I indicates that the jdk program name is case-insensitive.
Rpm-e -- nodeps program name
Description of parameters: the E-generation table eraser. Deleting nodeps indicates deleting other dependent packages.
1.3 install jdk
1.3.1 create an installation directory
Mkdir-p/usr/local/jdk
Parameter description: p indicates recursive Directory Creation and parents. Here, it can be interpreted:
To create the jdk file, if/usr/local exists, it is not created, but it does not exist.
1.3.2 upload the JDK installation package
Create a folder to store the software to be installed.
You can use mkdir-p/usr/software.
1.3.3 Extract
Tar-zxvf program file name-C/usr/local/jdk
Parameter description: z: Decompress. gzip at the end of the attribute, x: decompress, v: Display process, f: this parameter must be the last parameter, followed by the file name to be decompressed.
1.3.4 configure Environment Variables
Add the following information at the end of vim/etc/profile:
Export JAVA_HOME =/usr/local/java/jdk1.7.0 _ 80
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export PATH = $ JAVA_HOME/bin: $ PATH
1.3.5 reload the environment variable configuration file
Source/etc/profile
1.3.6 test whether java-version is successful