I. Installation Note: if you are not in the root account, first switch to the root account: Create the installation directory for suroot, create the installation path under/usr/java, and test the file to this path: # mkdir/usr/java can be obtained by using the cp file name command, usr/java directory 1, jdk-6u11-linux-i586.bin this is a self-extracting file, installed on linux as follows: # chmod755jd
I. Installation
NOTE: If not under the root account, switch to the root account: su root
Create the installation directory, create the installation path under/usr/java, and obtain the file to this path:
# Mkdir/usr/java
You can use the cp file name command to test the directory usr/java.
1,Jdk-6u11-linux-i586.binThis is a self-decompressed file. It is installed on linux as follows:
# Chmod 755 jdk-6u11-linux-i586.bin
#./Jdk-6u11-linux-i586.bin (note that this step must be in the directory where the jdk-6u11-linux-i586.bin is located)
Ii. Configuration
# Vi/etc/profile
Note: select "E" and click "enter". The parameter is editable. Otherwise, the parameter cannot be edited.
Add the following content to it:
Install
Export JAVA_HOME =/usr/java/jdk1.6.0 _ 35
Export JAVA_BIN =/usr/java/jdk1.6.0 _ 35/bin
Export PATH = $ PATH: $ JAVA_HOME/bin
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export JAVA_HOME JAVA_BIN PATH CLASSPATH
Save and launch: wq
To make the/etc/profile file take effect immediately after modification, run the following command:
#./Etc/profile
Note: There are spaces between. and/etc/profile.
Restart Test
Java-version