Linux Mint (Ubuntu, Debian) 18 Modify environment variables

Source: Internet
Author: User
Tags linux mint

modifying environment variables

[Plain]View PlainCopyPrint?
    1. sudo gedit/etc/profile
sudo gedit/etc/profile

Add the following code at the end of the profile file

[Plain]View PlainCopyPrint?
    1. Export java_home=/usr/lib/jvm/java-7-openjdk-i386
    2. Export path= $JAVA _home/bin: $PATH
    3. Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export Java_home=/usr/lib/jvm/java-7-openjdk-i386export path= $JAVA _home/bin: $PATHexport classpath=.: $JAVA _home/ Lib/dt.jar: $JAVA _home/lib/tools.jar

The modified environment variable is then added to the system.

[Plain]View PlainCopyPrint?
    1. Source/etc/profile
Source/etc/profile

TIP: Note the following two questions during use:
(1) "source/etc/profile" This command can not be used in front of add sudo!
(2) The personal instances of multiple environment variables appended to path are as follows:
java_home=/opt/java/jdk1.8.0_152

    PATH=$JAVA_HOME/bin:$PATH    CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar    export ANT_HOME=/opt/apache-ant-1.10.1    export JAVA_HOME=/opt/java/jdk1.8.0_152    export PATH=$JAVA_HOME/bin:$PATH    export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar    export ANT_HOME=/opt/apache-ant-1.10.1    export PATH="$PATH:$ANT_HOME/bin"

(3) In addition, through the environment variables above the individual, can also be executed directly in the shell command window, after execution will be added to the environment variable
Reference Document: Http://www.cnblogs.com/jpfss/p/7895926.html

Linux Mint (Ubuntu, Debian) 18 Modify environment variables

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.