您现在的位置是: 首页 > 运维 CentOS 安装JDK
CentOS 安装JDK
2020-05-19 【运维】 3150人已围观 5592次浏览
简介CentOS 安装JDK
首先下载JDK_1.8
也可以通过wget方式,直接在服务器上下载(但是由于下载页面授权问题,会导致下载到的就是一个几KB的页面文件)
下载完成后,解压
tar -zxvf jdk-8u211-linux-x64.tar.gz
然后移动到指定的目录,比如/opt
mv jdk1.8.0_211 /opt
修改配置文件
vim /etc/profile
如果没有 vim 执行
yum -y install vim
然后在文件头部新增
export JAVA_HOME=/opt/jdk1.8.0_211
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
wq保存退出
然后让配置文件立即生效
source /etc/profile
最终验证是否安装成功,执行
java -version
或
java
或
javac
出现Java版本或提示信息,则安装成功
很赞哦! (0)
下一篇:Linux 安装 Tengine
相关文章
- Zookeeper 找不到或无法加载主类 org.apache.zookeeper.server.quorum.QuorumPeerMain
- 查看MySQL默认读取的配置文件
- LNMP 手动更新 SSL 证书
- 迁移 Docker 目录
- LNMP定时备份任务教程(支持排除指定文件夹)
- 使用 OpenSSL 将 pfx 格式证书转为 pem 格式
- 解决Lost connection to MySQL server at 'reading initial communication packet' 的方法
- Nginx转发阿里云OSS内网流量
- Debian/Ubuntu无netstat命令解决方案
- Windows CMD 常用命令
点击排行
- Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR DISABLE You can't write or read against a disable instance
- Debian apt 使用国内镜像
- RocketMQ 出现 sendDefaultImpl call timeout 问题
- 类 BASE64Decoder 程序包 sun.misc 找不到符号
- SpringBoot @NotBlank 不生效问题
- 记一次 Mybatis-Plus 自动填充无效问题解决
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
- nuxt 项目完整部署方案
站长推荐
猜你喜欢
- LNMP定时备份任务教程(支持排除指定文件夹)
- PHP 在执行 composer install 时出现提示 PHP Fatal error: Allowed memory size of XXXXXX bytes exhausted <...>
- SpringBoot 启动提示 Requested bean is currently in creation: Is there an unresolvable circular reference?
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
- Vue 路由跳转后不在顶部
- mybatis中大于等于小于等于的写法
- SpringBoot 集成 Elasticsearch 7.8.1 出现错误 Factory method 'elasticsearchRestHighLevelClient' threw exception; nested exception is java.lang.NoSuchFieldError: IGNORE_DEPRECATIONS
- 使用 OpenSSL 将 pfx 格式证书转为 pem 格式
- CentOS 安装 Docker
- LNMP 手动更新 SSL 证书