"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

    Cd/user/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

    Vim/etc/profile

    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

    Source/etc/profile

  7. check that the JDK is installed successfully

    java-version

    back to JDK version

    Javac    The JDK was installed successfully

"Linux" JDK installation and environment variable configuration

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.

Tags Index: