1. Check the version of the system installation:
Rpm-qa | -qa | grep GCJ
2. View and delete
[Email protected] ~]# rpm-qa|grep Jdkjava-1.6.0-openjdk-devel-1.6.0.0-1.41.1.10.4.5. Alios6.x86_64java-1.6.0-openjdk-1.6.0.0-1.41.1.10.4.5. Alios6.x86_64[[email protected]~]# rpm-e--nodeps java-1.6.0-openjdk-devel-1.6.0.0-1.41.1.10.4.5. Alios6.x86_64[[email protected]~]# rpm-e--nodeps java-1.6.0-openjdk-1.6.0.0-1.41.1.10.4.5. Alios6.x86_64[[email protected]~]# rpm-qa|grep GCJLIBGCJ-4.4.6-3.5. Alios6.x86_64[[email protected]~]# rpm-e--nodeps libgcj-4.4.6-3.5. Alios6.x86_64[[email protected]~]# Java-bash:/usr/bin/java:no such file or directory
3. Installing the JDK
3.1 Download JDK
Jdk7:http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html
3.2 Create the directory where the JDK is installed:
3.3 Unzip the file to the folder you created:
Tar zxvf jdk-7u79-linux-x64.gz -c/usr/local/java
3.4 Add the following command at the end of the profile file:
Vim/etc/profile
#JAVA_HOME
Export java_home=/usr/local/jdk1.7.0_79
Export path= $PATH: $JAVA _home/bin
3.5 Refreshing environment variables
Source/etc/profile
3.6 Testing Whether Java commands are available
Java-version
Complete
Linux server uninstalls native default installed JDK