1. Download the corresponding Java SDK version from the sun Portal
I downloaded the jdk-6u6-linux-i586-rpm.bin version.
2. grant permissions to the downloaded file
1. Generally, the root permission is required. Enter Su at the $ prompt and enter the password to enter the root mode. Prompt #
2, # chmod 755 jdk-6u6-linux-i586-rpm.bin
3, #./jdk-6u6-linux-i586-rpm.bin
4. # rpm-IVH jdk-6u6-linux-i586-rpm
3. Set Environment Variables
There are three ways to modify the network
1. Modify/etc/profile
2. Modify. bashrc
3. directly modify it in Shell
I have tried either of the three methods, but none of them are successful. And then solved with the help of friends.
The modification method is as follows:
$ VI. bash_profile
Add the following to this file:Code:
# Set Java environment
Export java_home =/usr/Java/jdk1.6.0 _ 06
Export classpath =.: $ java_home/lib: $ java_home/JRE/lib:/usr/Java/jdbc
Export Path = $ java_home/bin: $ java_home/JRE/bin: $ path
Restart.
In addition, when a file is created using VI during the test, you must grant the read/write permission to the file to modify the file. The command is as follows:
Chmod R + W file name