Linux system installation jdk tutorial

Linux system installation jdk tutorial

1. jdk download (jdk-8u161-linux-x64.tar): https://pan.baidu.com/s/1pIaCbhSrJUwPFKrJeniqZw Extraction code: hklz
2. Upload the downloaded jdk compressed package to the Linux system via ftp Under the current user, my current logged-in user is the root user
3. Unzip the uploaded jdk to the /usr/local/ directory, and the command is as follows:

tar -zxvf ./jdk-8u161-linux-x64.tar.gz -C /usr/local/
x:表示从tar包中解压出来
z:表示 tar 包是被 gzip 压缩过的,所以解压时需要用 gunzip 解压
v:显示详细信息
f:指定被解压的文件是***.tar.gz
-C表示将解压后的文件放在-C指定的路径下

注意:要用root用户或拥有root权限的用户才能解压成功,否则回报错:文件夹找不到

4. Execute cd /usr/local, and you will see jdk1.8 that we decompressed.
insert image description here
5. Configure environment variables, there are two configuration methods.
The first method : command input cd, press Enter ls -a, press Enter to find .bash_profile and edit insert image description here
the configuration environment Variables:
insert image description here
Execute: source .bash_profile to make the configuration file take effect
insert image description here
The second method: find the following file: profile edit
insert image description here
Configure environment variables: insert image description hereExecute: source .bash_profile to make the configuration file take effect

6. Verify jdk
insert image description here

Guess you like

Origin blog.csdn.net/weixin_41377835/article/details/105437667