Installing the JDK in Linux is as follows:
1. Download the JDK from the internet first, download it and put it in the/home directory, but other places are OK.
Enter the installation directory
#cd/home
#cp jdk-1_6_0_03-linux-i586.rpm/usr/local
#cd/usr/local
To add an executable permission to all users
#chmod +x Jdk-1_6_0_03-linux-i586.rpm.bin
#./jdk-1_6_0_03-linux-i586.rpm.bin
The file jdk-1_5_0_02-linux-i586.rpm is generated and the executable permissions are added to all users
#chmod +x jdk-1_5_0_02-linux-i586.rpm
Setup program
#rpm-IVH jdk-1_5_0_02-linux-i586.rpm
The installation protocol appears, and so on, press accept.
2. Set environment variables.
#vi/etc/profile
On the last side join
#set Java Environment
Java_home=/usr/jdk-1_6_0_03
Classpath=.: $JAVA _home/lib.tools.jar
Path= $JAVA _home/bin: $PATH
Export Java_home CLASSPATH PATH
Save exit.
3. Use the echo command at the terminal to check environment variable settings.
#echo $JAVA _home
#echo $CLASSPATH
#echo $PATH
4. Check that the JDK is installed successfully.
#java-version
If you see the JVM version and related information, the installation is successful!