LINUX-JAVA-JDK Complete Configuration process

Source: Internet
Author: User

The JDK is a popular development toolkit that contains the JRE that is the component that supports the JVM running.01. JDK Download JDK DecompressionTar zxf jdk-8u131-linux-x64.tar.gz03, the configuration of the JDK environment variable
    • A configuration file/etc/profile (global level) that modifies environment variables directly. bash_profile (user-level)
Vim/etc/profileexport java_home=/elk5.4/jdk1.8.0_131export jre_home= $JAVA _home/jreexport CLASSPATH=.: $JAVA _home/ Lib: $JRE _home/libexport path=$PATH: $JAVA _home/bin: $JRE _home/bin #这种不会替换的当前的Java的环境变量 Export path= $JAVA _home/bin: $JRE _home/bin:$PATH # $PATH write to the back, can be replaced. The bin under path is in a sequential ordersource/etc/profile #更新 Env #明白了吧, Java in frontPath=/root/jdk1.8.0_131/bin:/root/jdk1.8.0_131/jre/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usR/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
    • Quickly switch JDK versions with update-alternatives
Usage:Alternatives--install <link> <name> <path> <priority>[--initscript <service>] [--slave <link> <name> <path>]* Alternatives--remove <name> <path> Alternatives --auto <name> Alternatives--config <name> alternatives--display <name> Alternatives --set <name> <path> Common options:--verbose--test--help--usage--version--altdir <directory> --admindir <directory> #默认通过jdk-rpm installed [[email protected] ~]# ll/usr/bin/javalrwxrwxrwx. 1 root root 22 May 14 11:58/usr/bin/java-/etc/alternatives/java[Email protected] ~]# Ll/etc/alternatives/java lrwxrwxrwx. 1 root root 29 May 14 11:58/etc/alternatives/java-/elk5.4/jdk1.8.0_131/bin/javaoptions for adding JDKUpdate-alternatives--install/usr/bin/java Java/elk5.4/jdk1.8.0_131/bin/javaSelect the current JDK version[Email protected] ~]#update-alternatives--config JavaA total of 4 programs provide "Java".           Select Command-----------------------------------------------* 1/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java 2 /usr/lib/jvm/jre-1.5.0-gcj/bin/java 3/usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java + 4/e Lk5.4/jdk1.8.0_131/bin/java Press Enter to save the current selection [+], or type select number 4 that is, when the pro-Java environment variable learning is endless, the problem is always inadvertently appeared, the ancestors have come up with a solution.

LINUX-JAVA-JDK Complete Configuration process

Related Article

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: 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.