Java_home directory for configuring JDK under Linux
1. Create JDK folder, upload JDK, unzip
#创建目录 mkdir /usr/java# decompression unzip Jdk1. 7. 0_45_20150317. Zip
2. Edit the configuration file, configure environment variables
VI /etc/profile
Add the following configuration
Export java_home=/usr/java/jdkexport PATH= $PATH: $JAVA _home/bin: $JAVA _home/jre/binexport CLASSPATH =.: $JAVA _home/lib: $JAVA _home/jre/lib: $CLASSPATH
3, save after exiting, run
Echo $JAVA _home
You can see that the JDK environment variable is not updated, run a command, note that there are spaces
. /etc/profile
Then look at the java_home variable, the configuration is in effect, point to/USR/JAVA/JDK, but the real JDK directory is not this, but/usr/java/jdk1.7.0_45_20150317.
4. Create a soft link to create a more concise, named shortcut to the JDK's real directory.
Ln -s/usr/java/jdk1. 7. 0_45_20150317/usr/java/jdk
Complete. Linux configuration JDK Environment variables are simple, but remember to run. /etc/profile command to make the configuration take effect immediately. You can create soft links to simplify variable links.
Linux under Configure JDK and Soft link command ln use