First go to Oracle download Linux under the JDK compression package, I downloaded the jdk-7u4-linux-i586.tar.gz file, the next good after the direct decompression
STEP1:
# Copy the Unpacked Jdk1.7.0_04 folder to the/USR/LIB/JVM directory with the highest privileges
sudo cp-r ~/jdk1.7.0_04//usr/lib/jvm/
STEP2:
# Configure Environment variables
Copy Code code as follows:
At the end add:
Copy Code code as follows:
Export Java_home=/usr/lib/jvm/jdk1.7.0_04
Then save the shutdown, using the source update
$ source ~/.profile
To view the value of a java_home using the ENV command
$ env
If java_home=/usr/lib/jvm/jdk1.7.0_04, this indicates a successful configuration.
STEP3:
Copy Code code as follows:
# Modify the default JDK for the system.
$ sudo update-alternatives--install/usr/bin/java Java/usr/lib/jvm/jdk1.7.0_04/bin/java 300
It would be nice to enter the numbers before the Sun jdk.
Copy Code code as follows:
$ sudo update-alternatives--install/usr/bin/javac Javac/usr/lib/jvm/jdk1.7.0_04/bin/javac 300
$ sudo update-alternatives--config java
$ sudo update-alternatives--config javac
STEP4:
Then enter Java-version, see the following information, it is changed to the Sun JDK:
Java Version "1.7.0_04"
Java (TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot (TM) Server VM (build 23.0-b21, Mixed mode)
Problems that may exist:
1. Hint missing libjli.so Unable to start ..., encounter this problem is you download the JAVAJDK compression package is incomplete, or your decompression mode is not caused, directly to the current path, and then copy to the directory you need, JDK installation directory can be arbitrarily selected, For example, you can put it in the home directory,
libjli.so file in: ~/jdk1.7.0_07/jre/lib/i386/jli/libjli.so
2. You may not be able to configure success, you need to uninstall the previously installed OPENJDK, you can remove the command line
3. Different versions of the JDK, version number as modified on the