1 upload the JDK that will be installed to the Linux system first
2 Move the uploaded JDK to the/usr/local folder
MV jdk-6u24-linux-i586.bin/usr/local/
3 Go to this folder
Cd/usr/local
4 Add an executable permission to the JDK you just moved over
chmod 777 Jdk-6u24-linux-i586.bin
After successful execution of the flag is LS view, the file becomes dark
After 5, execute the file and complete the installation.
./Jdk-6u24-linux-i586.bin
(If the. bin file is not, but the. tar.gz file, you can use the TAR-ZXVF jdk-6u24-linux-i586.tar.gz command to decompress)
When you are finished, a new folder is generated under the folder jdk1.6.0_24
6 Change the new folder jdk1.6.0_24 to JDK
MV JDK1.6.0_24/JDK
7 Add the JDK to the Java environment variable
(1) Open/etc/profile
Gedit/etc/profile
(2) Add environment variables at the end of the file
Java_home=/usr/local/jdk
Path= $PATH: $JAVA _home/bin
(3) Execute the profile file to make the changes effective
Source/etc/profile
8 Test if the JDK installation was successful
Java-version
When the interface shown appears, the JDK installation is successful
Installing JDK under Linux