JDK installation in Linux is relatively easy. Take JDK 5 as an example: JDK.
JDK installation in Linux is relatively easy. Take JDK 5 as an example:
: Http://java.sun.com/j2se/1.5.0/download.jsp
Download JDK1.5 latest bin version such as: jdk-1_5_0_12-linux-i586.bin to specified directory
Execute the sh jdk-1_5_0_12-linux-i586.bin file to decompress the generated directory and copy it to the specified directory, such as:/usr/share.
The JDK directory is/usr/share/. In this example, It is/usr/share/jdk1.5.0 _ 12.
Vi/etc/profile
Join:
JAVA_HOME = "/usr/share/jdk1.5.0 _ 12"
PATH = $ PATH: $ JAVA_HOME/bin
Export CLASSPATH =.: $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/lib/dt. jar
Export PATH JAVA_HOME
The environment variable takes effect if you log out of the user or restart the machine.
Run java-version on the terminal. if the version you want to install is displayed, the installation is successful. In this example, it is: java version "1.5.0 _ 12"
If the version number is incorrect, check whether other versions have been installed before. delete the previously installed version. If JAVA-related options are selected during linux installation, the/usr/bin directory contains the java executable file, which can be renamed or deleted.