Installation of jdk in linux and configuration of Environment Variables
Jdk-7u71-linux-i586.tar.gz
Jdk-7u75-linux-x64.tar.gz
1. Upload a package
2. view the installer
Rpm-qa | grep-I jdk
3. Delete the specified jdk
Rpm e java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.el6.i686
Rpm e java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.i686
4. Check whether the installer is deleted again.
Rpm-qa | grep-I jdk
5. Enter the jdk directory to decompress the package.
Tar-xvf jdk-7u71-linux-i586.tar.gz
6. Create a directory for storing jdk
Mkdir-p/usr/local/jdk
7. Move the decompressed jdk to the newly created directory.
Mv jdk1.7.0 _ 71 // usr/local/jdk/
8. Go to the/usr/local/jdk/jdk1.7.0 _ 75/directory.
Cd/usr/local/jdk/jdk1.7.0 _ 75/bin
9. test whether the jdk is successfully executed.
./Java-version
10. Enable System Environment Configuration
Vim/etc/profile
Open/etc/profile in a text editor
Add the following content to the end of the profile file:
Export JAVA_HOME =/usr/share/jdk1.6.0 _ 14
Export PATH = $ JAVA_HOME/bin: $ PATH
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
12. recompilation takes effect
Source/etc/profile
/Usr/local/jdk/jdk1.7.0 _ 75/