RedHat download and install JDK method

  

In RedHat system, because of the need of programming, you need to install JDK on the system, because you need to use the command to install, so many people do not know how to install, the following small series will introduce you Under RedHat download and install JDK method, need friends can come to understand.

installation

RedHat6 steps:

1) Download the JDK

downloaded jdk-6u20-linux-i586.bin, can go to the official website to download other versions .

Copy the file jdk-6u20-linux-i586.bin to the opt directory, or you can put it in another directory.

2) Decompress the file jdk-6u20-linux-i586.bin

In the terminal, type:

[root@bogon opt]# . /jdk-6u20-linux-i586.bin

You can extract the file jdk-6u20-linux-i586.bin to the folder jdk1.6.0_20

3) Configure the environment variable < Br>

Edit the .bashrc or .profile file in the user directory. If you want to work in all users' shells, edit the /etc/profile file. Also add the following:

export JAVA_HOME=/opt/jdk1.6.0_20

export JRE_HOME=/opt/jdk1.6.0_20/jre

export CLASSPATH= . :$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH

export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

Execute the command:

[ Root@bogon opt]# source /etc/profile

4) Verify that the JDK is successfully installed

Terminal input command: java -version

[root@bogon etc]# Java -version

java version “1.6.0_20”

Java(TM) SE Runtime Environment (build 1.6.0_20-b02)

Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)

indicates that the JDK installation is successful.

The above is the RedHat installation JDK method introduced, after using the command to install the JDK, but also to verify whether the JDK installation is successful, the method described in this article is installed in RedHat6, other versions can be a reference.

Copyright © Windows knowledge All Rights Reserved