modifying environment variables
[Plain]View PlainCopyPrint?
- sudo gedit/etc/profile
sudo gedit/etc/profile
Add the following code at the end of the profile file
[Plain]View PlainCopyPrint?
- Export java_home=/usr/lib/jvm/java-7-openjdk-i386
- Export path= $JAVA _home/bin: $PATH
- 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?
- 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