Install jdk1.5 in FC5andfc4 and set environment variables-Linux general technology-Linux programming and kernel information. For details, refer to the following. 1. Download jdk.
From here you can find the latest JDK: http://java.sun.com/
Based on your own machine to download the corresponding version, I downloaded is the jdk-1_5_0_02-linux-i586.bin, this is J2SE Development Kit 1.5 update 5 for Linux sh self-decompressed execution script. The package has been installed.
1. Release the Software Package
View All files in the current directory
[Lee @ lee-Linux-OS linuxsoft] $ ls
Jdk-1_5_0_02-linux-i586.bin
Execute the sh self-extracting script
[Lee @ lee-Linux-OS linuxsoft] $./jdk-1_5_0_02-linux-i586.bin
Do you agree to the above license terms? [Yes or no] yes
View All files in the current directory again
[Lee @ lee-Linux-OS linuxsoft] $ ls
Jdk1.5.0 _ 04 jdk-1_5_0_02-linux-i586.bin
In fact, the sh script will release a folder named jdk1.5.0 _ 05 to the current directory.
2. Configure the Java compiling and running environment
1. Place Java
Move or copy the jdk1.5.0 _ 02 folder to the/usr/local directory.
[Lee @ lee-Linux-OS linuxsoft] $ mv jdk1.5.0 _ 02/usr/local/
2. Create shortcuts to replace GCJ
Create shortcuts (static links) for java and javac to replace gcj.
# Cd/usr/bin
# Ln-s-f/usr/local/jdk1.5.0 _ 02/jre/bin/java
# Ln-s-f/usr/local/jdk1.5.0 _ 02/bin/javac
The-f parameter of the ln command is used to forcibly overwrite the existing/usr/local/java static link file. Because the bin folder in the jdk directory can replace/jdk1.5.0 _ 02/jre/bin, you can also directly use the/jdk1.5.0 _ 02/bin path.
Note: GCJ is not permanently deleted from your computer. You can still find it using the whereis gcj command and use it as needed.
1. Configure environment variables (personalized configuration of independent end users ).
Edit the. bashrc of the current user, that is: