1, First, download jdk-7u4-linux-i586.tar.gz
2, Copy jdk-7u4-linux-i586.tar.gz to the/usr/lib/JVM/directory. If no JVM folder exists, create the folder. Run the following command:
Sudo mkdir JVM // create a folder JVM
Sudo CP-R ~ /Download/jdk-7u4-linux-i586.tar.gz/usr/lib/JVM
Sudo tar-zxvg jdk-7u4-linux-i586.tar.gz
3, Set environment variables,
Method 2: modify this Vim ~ /. Bashrc
Add the following at the end of the file:
# Java
Export java_home =/usr/lib/JVM/jdk1.7.0 _ 21
Export jre_home =$ {java_home}/JRE
Export classpath =. :$ {java_home}/lib :$ {jre_home}/lib
Export path =$ {java_home}/bin: $ path
Save and exit. Enter the following command to make it take effect immediately.
Code: Source ~ /. Bashrc
4. modify the default JDK of the system (not to be lazy !)
sudo Update-alternatives -- install/usr/bin/Java/usr/lib/JVM/jdk1.7.0 _ 21/bin/Java 300
sudo update -alternatives -- install/usr/bin/javac/usr/lib/JVM/jdk1.7.0 _ 21/bin/javac 300
sudo Update-alternatives
-- config Java
5. detection, input Java-version