Skip to content

Commit f495bb7

Browse files
committed
如何在debian 8上配置java 8
1 parent 3dfcf79 commit f495bb7

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
layout: post
3+
title: "如何在debian 8上安装java 8"
4+
categories: 教程
5+
tags: debian jdk安装
6+
author: Benjamin
7+
---
8+
9+
* content
10+
{:toc}
11+
12+
具体步骤如下:
13+
1. 进入或创建一个你希望安装java的文件夹your_software_dir。通过如下命令下载jdk:
14+
15+
`wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u191-linux-x64.tar.gz`
16+
17+
2. 解压文件 `tar -zxvf jdk-8u191-linux-x64.tar.gz`
18+
19+
3. 配置java环境变量
20+
* vim /etc/profile
21+
* 将下面内容复制到底部:
22+
```sh
23+
JAVA_HOME=your_software_dir/jdk1.8.0_191
24+
25+
PATH=$JAVA_HOME/bin:$PATH
26+
27+
export PATH JAVA_HOME
28+
```
29+
* `:wq`保存文件
30+
* 使用命令`source /etc/profile`使配置生效
31+
32+
4. `java -version`验证是否安装成功

0 commit comments

Comments
 (0)