This article is to give me the time of installation will own easy to use, so the content is very simple, usually very easy to install on wendows system, but switched to linux system on top of the circle to Mongolia.
First, download the file jdk
I offer this is the official address: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html . If, after you have downloaded well you can skip this step. Here is my downloaded pictures
Once downloaded you get
We'll just put this file linux directory what can be.
Second, extract the compressed jdk
First with the command cd you put into the archive folder and then execute the following command unzip
Unzip command: tar -zxvf jdk-8u181-linux-x64.tar.gz
After the successful execution you will see a file, here I have to say my upload the compressed file before linux I changed my name jdk8.gz's so easy to enter the command, avoid this like the above so long.
After unpacking I and the jdk1.8.0_181 folder. Now we are done, let's start configuring the environment variables just fine.
Third, configure the environment variables
If you go to Baidu certainly see other article is to let you enter the command vim / etc / profile to open the file to make changes, in fact, is right, but if you linux commands are not supposed to be, then we pass this software xftp open the / etc / profile file which in the end this is what the hell. Here is what I find out the process
In order to facilitate the changes I see me, he came out of the above wendows I opened to see what the hell.
After I turned on the network in accordance with said adding these configurations in the back, go back and replace the restart to complete. Here are the contents of the configuration
export JAVA_HOME=/home/wanmeng/jdk/jdk1.8.0_181
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
Assignment back JAVA_HOME is actually extracting file address above me, other do not need to be modified, it is complete.
If you configure too wendows the jdk environment variable, then back here this configuration is quite similar.