Original intention
Today saw the course at other small partners, looking headache, for the novice is a direct obstacle - puzzled, I wrote such a thing, I hope little friends detours on the road to learn, you can save to unnecessary trouble, and precious time |
download link
Linux-jdk32 bit systems download Baidu cloud
extraction code: n2k4
Linux-bit systems jdk64 download Baidu cloud
extraction code: jfje
First, upload
Here it is usedVMware tools文件共享~
Located mntin -
here I use64-bit JDK
Create a named javafolder
and putjdk-8u161-linux-x64.tar.gz移动到java文件夹中
代码:
sudo mkdir /java ##创建JAVA文件夹
Second, unzip
For previouscdenterjava
其次ls看一下文件夹里面的东西
然后解压jdk-8u161-linux-x64.tar.gz
Enter the following code to decompress
Code:
tar -zxvf jdk-8u161-linux-x64.tar.gz ##解压jDK
得到jdk1.8.0_161
Third, configure the environment variables
usehisenterROOT privileges
dcyang@dcyang-virtual-machine:~$ su
密码
root@dcyang-virtual-machine:/home/dcyang# sudo gedit /etc/profile ##编辑profile
enterrootEnter the code:sudo gedit /etc/profile
Open profileConfiguration
Copy the following variables profilein
export JAVA_HOME=/java/jdk1.8.0_161
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=.:${JAVA_HOME}/bin:$PATH
That the environmental variables
1, restart shutdown
2, enter the following code
source /etc/profile
Fourth, check
In a terminal
java -version ##检查JDK是否安装完成