"Linux" JDK installation and environment variable configuration

Source: Internet
Author: User

Tags: col system configuration Linux javac $path family style line new

  1. After logging in to Linux, switch directories to /usr/local


  2. new Folder in /usr/local directory java to store jdk files

    mkdir Java

  3. in folder Java download jdk file ( jdk network path can be replaced according to your own needs)

    First switch directory to Java

    cd java

    download online JDK

    wget--no-check-certificate--no-cookies--header "cookie:oraclelicense= Accept-securebackup-cookie "http://download.oracle.com /otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-x64.tar.gz


  4. Unzip the JDK to the current directory

    Tar jdk-8u181-linux-x64.tar.gz

    Delete the package after decompression is complete

    RM jdk-8u181-linux-x64.tar.gz

  5. To edit a configuration file, configure environment variables


    Add to:

    Export java_home=/usr/local/jdk1.7.0_71

    Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar

    Export path= $JAVA _home/bin: $PATH

    Press ESC, enter : Wq, save and exit

  6. Reload the system configuration file


  7. check that the JDK is installed successfully


    back to JDK version

    Javac    The JDK was installed successfully

"Linux" JDK installation and environment variable configuration

Related Article

Beyond APAC's No.1 Cloud

19.6% IaaS Market Share in Asia Pacific - Gartner IT Service report, 2018

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.