how to install JDK on centos

For a new issued VM with OS CentOS7, if you executed "java -version" and found returned with "cmd not found" error, that denotes you don't have a jdk on your VM.

It's very simple to install JDK on centos7. Here is the steps.

1 download install packet on the Oracle website: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html, download the jdk-8u181-linux-x64.tar.gz, remember probabaly you can't unzip it if you download directly by "wget" cmd, in this case you just need to download manually and push the file on the server. The reason for doing this is you must accept the agreement before you download the jdk file and wget can't do that.

2 unzip the file with cmd "tar -xvf jdk-8u181-linux-x64.tar.gz", and you will get a folder "jdk1.8.0_181".

3 move that folder under "/usr/local" with "mv jdk1.8.0_181 /usr/local"

4 the last step is add the JAVA into the PATH, you may cd root directory, vim .bash_profile, and add these into it.

source .bash_profile to get this config taking effect, now you exe "java -version" and you will see the jdk version.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值