Install JDK on a Linux ECs instance

Source: Internet
Author: User

Install JDK on a Linux ECs instance

This article describes how to install JDK on a Linux ECs instance!

Environment: windows Server, Linux ECS (64-bit CentOS7), and JDK 8

Procedure:

1. Download JDK to a windows machine

Official Address: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Need to confirm your own Linux system bits, 32-bit download Linux x86 version (such as: jdk-8u45-linux-i586.tar.gz), 64-bit download Linux x64 version (such as: jdk-8u45-linux-x64.tar.gz)

2. Upload the JDK file to the Linux server.

Create a file directory java in the/usr/local/directory by Using ssh tools (none, such as WinSCP, upload the downloaded jdk package to the/usr/local/java directory.

3. decompress the JDK installation package

Decompress the JDK installation package through an ssh client (for example, SSH Secure Shell)

tar xvf jdk-8u45-linux-x64.tar.gz

4. Configure the JDK Environment

Edit the profile file in the/etc directory


Enter the following information at the end of the profile file, save and exit.

export JAVA_HOME=/usr/local/java/jdk1.8.0_45export JRE_HOME=/usr/local/java/jdk1.8.0_45/jreexport PATH=$PATH:/usr/local/java/jdk1.8.0_45/binexport CLASSPATH=./:/usr/local/java/jdk1.8.0_45/lib:/usr/local/java/jdk1.8.0_45/jre/lib

Vi ASSISTANT:

(1) line feed
Press esc + 'I "(letter), then press enter to wrap the line

(2) Save and exit/do not save and exit
Press esc + ':' (colon), enter q !, Press enter. Abandon the change and exit.
Press esc + ':' (colon), enter wq, and press Enter. Save changes and exit.

5. Restart the Linux System

Restart the system using ECs management tools

6. Check the installation status. java-version can check the jdk version!


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.