1. Permanent modification, valid for all users (not recommended for use, impact on users such as Oracle)
vi /etc/=/home/myuser/jdk1. 7 = $JAVA _home/bin: $PATHexport CLASSPATH=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
[Note]: If you want to take effect immediately after the file is modified, run #source/etc/profile
2. Permanent modification, valid for single user
vi /home/myuser/. Bash_profile// Add the following content at the end of the file =/home/myuser/jdk1. 7 = $JAVA _home/bin: $PATH export CLASSPATH=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
[Note]: If you want to take effect immediately after the file is modified, run #source/home/myuser/.bash_profile
3. Only valid for current Bash/shell
$ Export Java_home =/home/myuser/jdk1. 7 = $JAVA _home/bin: $PATH $ export CLASSPATH=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Settings for Java_home