Linux installation jdk1.8 and configuration environment variables

Source: Internet
Author: User
Each feeling with this is very simple, but every time to check, after all, with the wrong point behind all the more trouble, record, convenient to view later. The installation of the JDK under Linux is the same as the installation under Windows, before the installation of Windows is the first download of the compressed package, and then configure the environment variables. In fact, under Linux is the same.First step: Create a JDK installation directory(The/USR/LOCAL/SRC directory is empty, it is best to put our own download to this, easy to distinguish) command: Mkdir-p/usr/local/src/jdkStep Two: View the Setup programCommand: RPM-QA | Grep-i JDK If you have previously installed the JDK, the next installation must be removed before the cleanStep three: command to download the JDK package(Need networking, the download will take some time) This chapter uses a file with the suffix tar.gz (no installation required), such as the jdk-8u131-linux-x64.tar.gz command: [[email protected] jdk]# wget--no-check -certificate--no-cookies--header "Cookie:oraclelicense=accept-securebackup-cookie" http://download.oracle.com/ Otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gzNote: If the above wget command can not be used, error:-bash:wget:command not found. Execute the command (install dependent packages)yum-y Install wgetNote: Remember to add:--no-check-certificate--no-cookies--header "Cookie:oraclelicense=accept-securebackup-cookie" This section is designed to avoid user authentication.Fourth step: Unzip[[email protected] jdk]# TAR-ZXVF jdk-8u131-linux-x64.tar.gz The system generates a folder named: jdk1.8.0_131.        You can use the MV command to customize the file name. [Email protected] jdk]# MV jdk1.8.0_131 jdk1.8Fifth Step: Configure environment Variables[[email protected] bin]# Vi/etc/profile can see the contents of this file, the profile file is somewhat similar to the configuration of environment variables inside the Windows system, SHIFT + G is positioned to the last line This time click the A or I key, into the middle of the editing mode with a red coil up is required (Java_home is the JDK installation directory, and under Windows configuration)
export java_home=/usr/local/src/jdk/jdk1.8 export path= $PATH: $JAVA _home/bin
Sixth step: Exit the file, savePress the ESC key to enter: Wq Save and exitSeventh Step: Let the configuration file take effect[Email protected] jdk]# Source/etc/profileEighth step: see if the configuration is successful[[email protected] java1.8]# Java-version If the JDK version number appears, install and configure the environment variable successfully if the prompt command cannot be found, check the JDK configuration path for errors.

Linux installation jdk1.8 and configuration environment variables

Related Article
Large-Scale Price Reduction
  • 59% Max. and 23% Avg.
  • Price Reduction for Core Products
  • Price Reduction in Multiple Regions
undefined. /
Connect with us on Discord
  • Secure, anonymous group chat without disturbance
  • Stay updated on campaigns, new products, and more
  • Support for all your questions
undefined. /
Free Tier
  • Start free from ECS to Big Data
  • Get Started in 3 Simple Steps
  • Try ECS t5 1C1G
undefined. /

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.