Install JDK in RedHat 6.1 and redhat6.1 install jdk

Source: Internet
Author: User

Install JDK in RedHat 6.1 and redhat6.1 install jdk

I have been using Ubuntu for Hadoop learning. Recently, I need to deploy the production environment. The server is changed to RedHat. I also recorded the installation of JDK in RedHat 6.1, compare it with JDK 8 installed on Ubuntu 14.04.

Download JDK

You can download it from the Oracle official website or through the command line.

$ wget -c http://download.oracle.com/otn-pub/java/jdk/8u20-b26/jdk-8u20-linux-x64.tar.gz?AuthParam=1413271341_9a3119e730583f5388664bfa2b4eb0a7
Unzip and install
$ tar xzvf jdk-8u5-linux-x64.tar.gz

In order to save trouble, the installation can end here. In fact, there is no need to do any link or move the location. linux is just for freedom.

Configure Environment Variables

Add environment variables to the system, including PATH, CLASSPATH, and JAVA_HOME.

$ vi ~/.bashrc

When there is a file. bash_profile in RedHat, it is used to add user-defined configuration, but it is still used to. bashrc.

Add at the end of the file

export JAVA_HOME=~/jdk1.8.0_05export JRE_HOME=$JAVA_HOME/jreexport CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/libexport PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$HADOOP_HOME/sbin:$PATH

Save and exit, and make the script take effect:

$ source ~/.bashrc
Verify that the installation is successful
$ java -version

If the following information is printed, the operation is successful.

java version "1.8.0_05"Java(TM) SE Runtime Environment (build 1.8.0_05-b13)Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)

How does one install the Redhat linux system on a virtual machine and install JDK 16?

Networking:
Yum upgrade jdk
Or
Yum remove jdk
Yum install jdk remember to select the correct version
Go to the next jdk1.6 software package to install the SDK.

An error occurred while installing JDK 7 in redhat.

Jdk version too high
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.