Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CentOS 7 安装JDK #53

Open
johnnian opened this issue May 14, 2018 · 1 comment
Open

CentOS 7 安装JDK #53

johnnian opened this issue May 14, 2018 · 1 comment
Labels

Comments

@johnnian
Copy link
Owner

johnnian commented May 14, 2018

JDK 1.8 下载地址:

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

安装步骤:假设下载的JDK文件名是:jdk-8u171-linux-x64.tar.gz

1、 将 jdk-8u171-linux-x64.tar.gz 拷贝到/root 目录下,进行解压

[root@localhost ~]# tar -xzvf jdk-8u171-linux-x64.tar.gz 

2、将解压出来的文件夹剪切到/usr/share 目录下

[root@localhost ~]# mv jdk1.8.0_171 /usr/share/ 

3、 设置环境变量

[root@localhost ~]# vi /etc/bashrc 
#添加下面代码
JAVA_HOME=/usr/share/jdk1.8.0_171 
CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib 
PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH 
export PATH CLASSPATH JAVA_HOME 

4、 使修改立即生效

[root@localhost ~]# source /etc/bashrc 
@johnnian johnnian added the Linux label May 14, 2018
@duqicauc
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants