Install JDK1.8 on Ubuntu system (with network disk link)

1. Download JDK:

方式一:[官网链接](https://www.oracle.com/java/technologies/downloads/)
方式二:[百度网盘链接,提取码:eb9x](https://pan.baidu.com/s/1xkDIb2-BKbDkwPu10ovc-A)

2. Upload the compressed package to the server:

Insert image description here

3. Install JDK:

// 解压到当前目录
tar -zxvf jdk-8u152-linux-i586.tar.gz
// 进入到解压后的文件目录
cd jdk1.8.0_152/
// 查看当前文件路径
pwd

Insert image description here

4. Configure environment variables:

// 编辑bashrc文件
vim ~/.bashrc
// 输入小写i,添加如下配置
export JAVA_HOME=/home/ubuntu/shell/jdk1.8.0_152
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=.:${JAVA_HOME}/bin:$PATH
// 添加完成后输入按住Shift + “:”后输入wq保存退出

5. The configuration takes effect:

source ~/.bashrc

6. Check JDK version:

java -version

Insert image description here

Guess you like

Origin blog.csdn.net/weixin_43749805/article/details/132695793