Jdk installation in CentOS 7, centosjdk

Source: Internet
Author: User

Jdk installation in CentOS 7, centosjdk

1. Create a java directory under the/usr/directory

[Root @ localhost ~] # Mkdir/usr/java
[Root @ localhost ~] # Cd/usr/java

2. Copy jdk1.8 to the java directory and decompress it to the current directory.

[Root @ localhost java] # tar-zxvf jdk-8u131-linux-x64.tar.gz

3. Set Environment Variables

[Root @ localhost java] # vi/etc/profile

I add the following information

Set java environment
JAVA_HOME =/usr/java/jdk1.8.0 _ 131
JRE_HOME =/usr/java/jdk1.8.0 _ 131/jre
CLASS_PATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar: $ JRE_HOME/lib
PATH = $ PATH: $ JAVA_HOME/bin: $ JRE_HOME/bin
Export JAVA_HOME JRE_HOME CLASS_PATH PATH

: Wq save and exit

Make the saved environment variables take effect

[Root @ localhost java] # source/etc/profile

Verify that jdk configuration takes effect

[Root @ localhost java] # java-version
Open JDK version "1.8.0 _ 102"
OpenJDK Runtime Environment (build 1.8.0 _ 102-b14)
OpenJDK 64-Bit Server VM (build 25.102-b14, mixed mode)

 

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.