linux安装java
一、直接上传到服务器java jdk包
1.去官网https://www.oracle.com/technetwork/java/javase/downloads/jdk13-downloads-5672538.html去下载
2.然后将该包上传到linux服务器指定处,然后直接tar它
3.最后配置环境变量
二、yum安装
查看CentOS自带JDK是否已安装
1 |
|
有自带安装的JDK,应如下操作进行卸载CentOS系统自带Java环境
1 2 |
|
查看yum库中的Java安装包
1 |
[root@jadeshu tmp]# yum -y list java* Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Available Packages java-1.5.0-gcj.x86_64 1.5.0.0-29.1.el6 base java-1.5.0-gcj-devel.x86_64 1.5.0.0-29.1.el6 base java-1.5.0-gcj-javadoc.x86_64 1.5.0.0-29.1.el6 base java-1.5.0-gcj-src.x86_64 1.5.0.0-29.1.el6 base java-1.6.0-openjdk.x86_64 1:1.6.0.41-1.13.13.1.el6_8 base java-1.6.0-openjdk-demo.x86_64 1:1.6.0.41-1.13.13.1.el6_8 base java-1.6.0-openjdk-devel.x86_64 1:1.6.0.41-1.13.13.1.el6_8 base java-1.6.0-openjdk-javadoc.x86_64 1:1.6.0.41-1.13.13.1.el6_8 base java-1.6.0-openjdk-src.x86_64 1:1.6.0.41-1.13.13.1.el6_8 base java-1.7.0-openjdk.x86_64 1:1.7.0.241-2.6.20.0.el6_10 updates java-1.7.0-openjdk-demo.x86_64 1:1.7.0.241-2.6.20.0.el6_10 updates java-1.7.0-openjdk-devel.x86_64 1:1.7.0.241-2.6.20.0.el6_10 updates java-1.7.0-openjdk-javadoc.noarch 1:1.7.0.241-2.6.20.0.el6_10 updates java-1.7.0-openjdk-src.x86_64 1:1.7.0.241-2.6.20.0.el6_10 updates java-1.8.0-openjdk.x86_64 1:1.8.0.232.b09-1.el6_10 updates java-1.8.0-openjdk-debug.x86_64 1:1.8.0.232.b09-1.el6_10 updates java-1.8.0-openjdk-demo.x86_64 1:1.8.0.232.b09-1.el6_10 updates java-1.8.0-openjdk-demo-debug.x86_64 1:1.8.0.232.b09-1.el6_10 updates java-1.8.0-openjdk-devel.x86_64 1:1.8.0.232.b09-1.el6_10 updates java-1.8.0-openjdk-devel-debug.x86_64 1:1.8.0.232.b09-1.el6_10 updates java-1.8.0-openjdk-headless.x86_64 1:1.8.0.232.b09-1.el6_10 updates java-1.8.0-openjdk-headless-debug.x86_64 1:1.8.0.232.b09-1.el6_10 updates java-1.8.0-openjdk-javadoc.noarch 1:1.8.0.232.b09-1.el6_10 updates java-1.8.0-openjdk-javadoc-debug.noarch 1:1.8.0.232.b09-1.el6_10 updates java-1.8.0-openjdk-src.x86_64 1:1.8.0.232.b09-1.el6_10 updates java-1.8.0-openjdk-src-debug.x86_64 1:1.8.0.232.b09-1.el6_10 updates java-clearsilver.i686 0.10.5-16.el6 epel java-dirq.noarch 1.4-1.el6 epel java-dirq-javadoc.noarch 1.4-1.el6 epel java-service-wrapper.x86_64 3.2.5-23.el6 epel java-service-wrapper-javadoc.noarch 3.2.5-23.el6 epel java-sleep.noarch 2.1-6.el6 epel java-sleep-javadoc.noarch 2.1-6.el6 epel java_cup.x86_64 1:0.10k-5.el6 base java_cup-javadoc.x86_64 1:0.10k-5.el6 base java_cup-manual.x86_64 1:0.10k-5.el6 base javacc.x86_64 4.1-0.5.el6 base javacc-demo.x86_64 4.1-0.5.el6 base javacc-manual.x86_64 4.1-0.5.el6 base javassist.noarch 3.9.0-6.el6 base javassist-javadoc.noarch 3.9.0-6.el6 base javastroke.x86_64 0.5.1-33.el6 epel javatar.noarch 2.5-5.el6 epel javatar-javadoc.noarch |
yum库中java-1.8.0为例, "*"表示将java-1.8.0的所有相关Java程序都安装上
1 |
|