Virtual machine under Linux-JDK download and install (Baidu cloud) Novice detailed tutorial (writeup)

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

Here Insert Picture Description


Create a named javafolder
and putjdk-8u161-linux-x64.tar.gz移动到java文件夹中
代码:

sudo mkdir /java  ##创建JAVA文件夹

Here Insert Picture Description

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

Here Insert Picture Description
得到jdk1.8.0_161

Here Insert Picture Description

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

Here Insert Picture DescriptionCopy 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

Here Insert Picture Description

That the environmental variables
1, restart shutdown
2, enter the following code

source /etc/profile

Fourth, check

In a terminal

java -version  ##检查JDK是否安装完成

Here Insert Picture Description

Released two original articles · won praise 1 · views 101

Guess you like

Origin blog.csdn.net/qq_28579167/article/details/105172807
Recommended