Install jdk-6u45-linux-x64.bin in RedHat Linux
1. Download jdk-6u45-linux-x64.bin from Oracle
Download file: jdk-6u45-linux-x64.bin
2. Copy jdk-6u45-linux-x64.bin to/usr/java
3 go to the/usr/java directory and modify the executable chmod u + x jdk-6u45-linux-x64.bin for the jdk-6u45-linux-x64.bin
4. Perform jdk-6u45-linux-x64.bin
./Jdk-6u45-linux-x64.bin for Installation
5. Enter/etc/profile to configure environment variables.
6. Set environment variables and add the following lines at the end
Export JAVA_HOME =/usr/java/jdk1.6.0 _ 17
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export PATH = $ PATH: $ JAVA_HOME/bin
(Note: In linux, environment variables are separated by ":", not ";")
7. restart the system reboot
(Remember to restart the system after modification)
8. Test
[Root @ hn ~] # Vi Test. java
Class Test
{
Public static void main (String [] args)
{
System. out. println ("Hello World! ");
}
}
[Root @ localhost ~] # Javac test. java
[Root @ localhost ~] # Java test
Hello world!
Done!
RedHat Linux Server 5.4 installation jdk-6u22-linux-x64-rpm.bin