Install jdk in CentOS

Source: Internet
Author: User

Install jdk in CentOS
Install JDK
1. Upload the new jdk-7u80-linux-x64.rpm to/usr/local/
2. perform the following operations: rpm-ivh jdk-7u80-linux-x64.rpm
JDK is installed in/usr/Java by default.
3. Verify the installation: java-version
Java version "1.7.0 _ 80"
Java (TM) SE Runtime Environment (build 1.7.0 _ 80-b18)
Java HotSpot (TM) Client VM (build 24.45-b08, mixed mode, sharing)

4. Configure Environment Variables
The procedure is as follows:
Vi/etc/profile
Append the following content to the end of the file:
JAVA_HOME =/usr/java/jdk1.7.0 _ 45
JRE_HOME =/usr/java/jdk1.7.0 _ 45/jre
PATH = $ PATH: $ JAVA_HOME/bin: $ JRE_HOME/bin
CLASSPATH =: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar: $ JRE_HOME/lib
Export JAVA_HOME JRE_HOME PATH CLASSPATH

5. Make the modification take effect
Source/etc/profile

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.