1. go to the official website to download jdk. I downloaded the jdk-6u31-linux-i586.bin (the original did not give the address sorry, now add http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u32-downloads-1594644.html) 2. suroot & n
1. go to the official website to download jdk. I downloaded the jdk-6u31-linux-i586.bin (originally did not give the address sorry, now add a new http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u32-downloads-1594644.html)
2. su root // switch to the root account
3. mkdir/usr/java // Create a java folder under the usr Directory
4. mv jdk-6u31-linux-i586.bin/usr/java // Move the downloaded jdk file to the folder you just created on the premise that you download the jdk stored in the directory
5. chmod 777 jdk-bu31-linux-i586.bin // to the installation package to execute permissions on the premise is in the/usr/java Directory
6 ../jdk-6u31-linux-i586.bin // installation successful when none appears
7. vi/etc/profile // set environment variables
Add
Export JAVA_HOME =/usr/java/jdk1.6.0 _ 31 export CLASSPATH =.: % JAVA_HOME %/lib/dt. jar: % JAVA_HOME %/lib/tools. jar export PATH = $ PATH: $ JAVA_HOME/bin
Press Esc to exit the input: wq
Note: The delimiter for linux environment variables is colon ":" Rather than semicolon ";"
Then restart the machine reboot.
Finally, enter java-version to view and install the jdk version.