In some cases, it is better to summarize a document to configure the java environment for installing JDK in linux !!!
1. jdk ..... (Most of them end with. bin)
2. the directory to which you want to install jdk is put (usually your own directory or/usr/java indicates that you need to create mkdir-p/usr/java on your own)
3. Grant jdk installation package permissions (chmod 755 jdk-1_5_0_10-linux-i586-rpm.bin) As you like 777 can also!
4. (./jdk-1_5_0_10-linux-i586-rpm.bin run red part !)
There will be a piece of Sun Protocol, several times the Space key, when asked whether to agree, you can press yes.
The program automatically generates a jdk-1_5_0_10-linux-i586.rpm file, which is the main package and then automatically installs.
5. Configure Environment Variables
You can change the profile file in the etc directory to set environment variables. First, find the profile file in the etc directory.
Add the following code at the end of the opened profile file:
Note! JAVA_HOME =/usr/java/jdk1.5.0 _ 10 is the directory for your installation! Is the directory location in step 2.
Reference
Export JAVA_HOME =/usr/java/jdk1.5.0 _ 10
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export PATH = $ PATH: $ JAVA_HOME/bin
Author: "bbjava"