赞
踩
Ubuntu 版本信息:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
在开始安装之前,可以使用 java -version
命令检查是否安装过 JDK(第 1 行),如果返回如下信息(第 3 ~ 10 行),则该系统中大概率没有安装 JDK:
$ java -version
Command 'java' not found, but can be installed with:
sudo apt install default-jre # version 2:1.11-72, or
sudo apt install openjdk-11-jre-headless # version 11.0.13+8-0ubuntu1~20.04
sudo apt install openjdk-13-jre-headless # version 13.0.7+5-0ubuntu1~20.04
sudo apt install openjdk-16-jre-headless # version 16.0.1+9-1~20.04
sudo apt install openjdk-17-jre-headless # version 17.0.1+12-1~20.04
sudo apt install openjdk-8-jre-headless # version 8u312-b07-0ubuntu1~20.04
使用 sudo apt-get install openjdk-8-jdk
命令安装 OpenJDK(第 1 行):
$ sudo apt-get install openjdk-8-jdk Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: ca-certificates-java fonts-dejavu-extra java-common libatk-wrapper-java libatk-wrapper-java-jni libice-dev libpthread-stubs0-dev libsm-dev libx11-dev libxau-dev libxcb1-dev libxdmcp-dev libxt-dev openjdk-8-jdk-headless openjdk-8-jre openjdk-8-jre-headless x11proto-core-dev x11proto-dev xorg-sgml-doctools xtrans-dev Suggested packages: default-jre libice-doc libsm-doc libx11-doc libxcb-doc libxt-doc openjdk-8-demo openjdk-8-source visualvm icedtea-8-plugin fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei fonts-wqy-zenhei The following NEW packages will be installed: ca-certificates-java fonts-dejavu-extra java-common libatk-wrapper-java libatk-wrapper-java-jni libice-dev libpthread-stubs0-dev libsm-dev libx11-dev libxau-dev libxcb1-dev libxdmcp-dev libxt-dev openjdk-8-jdk openjdk-8-jdk-headless openjdk-8-jre openjdk-8-jre-headless x11proto-core-dev x11proto-dev xorg-sgml-doctools xtrans-dev 0 upgraded, 21 newly installed, 0 to remove and 181 not upgraded. Need to get 43.5 MB of archives. After this operation, 162 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 java-common all 0.72 [6,816 B] Get:2 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 openjdk-8-jre-headless amd64 8u312-b07-0ubuntu1~20.04 [28.2 MB] Get:3 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 ca-certificates-java all 20190405ubuntu1 [12.2 kB] Get:4 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 fonts-dejavu-extra all 2.37-1 [1,953 kB] Get:5 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 libatk-wrapper-java all 0.37.1-1 [53.0 kB] Get:6 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 libatk-wrapper-java-jni amd64 0.37.1-1 [45.1 kB] Get:7 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 xorg-sgml-doctools all 1:1.11-1 [12.9 kB] Get:8 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 x11proto-dev all 2019.2-1ubuntu1 [594 kB] Get:9 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 x11proto-core-dev all 2019.2-1ubuntu1 [2,620 B] Get:10 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 libice-dev amd64 2:1.0.10-0ubuntu1 [47.8 kB] Get:11 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 libpthread-stubs0-dev amd64 0.4-1 [5,384 B] Get:12 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 libsm-dev amd64 2:1.2.3-1 [17.0 kB] Get:13 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 libxau-dev amd64 1:1.0.9-0ubuntu1 [9,552 B] Get:14 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 libxdmcp-dev amd64 1:1.1.3-0ubuntu1 [25.3 kB] Get:15 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 xtrans-dev all 1.4.0-1 [68.9 kB] Get:16 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 libxcb1-dev amd64 1.14-2 [80.5 kB] Get:17 http://cn.archive.ubuntu.com/ubuntu focal-updates/main amd64 libx11-dev amd64 2:1.6.9-2ubuntu1.2 [647 kB] Get:18 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 libxt-dev amd64 1:1.1.5-1 [395 kB] Get:19 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 openjdk-8-jre amd64 8u312-b07-0ubuntu1~20.04 [69.9 kB] Get:20 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 openjdk-8-jdk-headless amd64 8u312-b07-0ubuntu1~20.04 [8,295 kB] Get:21 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 openjdk-8-jdk amd64 8u312-b07-0ubuntu1~20.04 [2,969 kB] Fetched 43.5 MB in 4min 53s (148 kB/s) Selecting previously unselected package java-common. (Reading database ... 158638 files and directories currently installed.) Preparing to unpack .../00-java-common_0.72_all.deb ... Unpacking java-common (0.72) ... Selecting previously unselected package openjdk-8-jre-headless:amd64. Preparing to unpack .../01-openjdk-8-jre-headless_8u312-b07-0ubuntu1~20.04_amd64.deb ... Unpacking openjdk-8-jre-headless:amd64 (8u312-b07-0ubuntu1~20.04) ... Selecting previously unselected package ca-certificates-java. Preparing to unpack .../02-ca-certificates-java_20190405ubuntu1_all.deb ... Unpacking ca-certificates-java (20190405ubuntu1) ... Selecting previously unselected package fonts-dejavu-extra. Preparing to unpack .../03-fonts-dejavu-extra_2.37-1_all.deb ... Unpacking fonts-dejavu-extra (2.37-1) ... Selecting previously unselected package libatk-wrapper-java. Preparing to unpack .../04-libatk-wrapper-java_0.37.1-1_all.deb ... Unpacking libatk-wrapper-java (0.37.1-1) ... Selecting previously unselected package libatk-wrapper-java-jni:amd64. Preparing to unpack .../05-libatk-wrapper-java-jni_0.37.1-1_amd64.deb ... Unpacking libatk-wrapper-java-jni:amd64 (0.37.1-1) ... Selecting previously unselected package xorg-sgml-doctools. Preparing to unpack .../06-xorg-sgml-doctools_1%3a1.11-1_all.deb ... Unpacking xorg-sgml-doctools (1:1.11-1) ... Selecting previously unselected package x11proto-dev. Preparing to unpack .../07-x11proto-dev_2019.2-1ubuntu1_all.deb ... Unpacking x11proto-dev (2019.2-1ubuntu1) ... Selecting previously unselected package x11proto-core-dev. Preparing to unpack .../08-x11proto-core-dev_2019.2-1ubuntu1_all.deb ... Unpacking x11proto-core-dev (2019.2-1ubuntu1) ... Selecting previously unselected package libice-dev:amd64. Preparing to unpack .../09-libice-dev_2%3a1.0.10-0ubuntu1_amd64.deb ... Unpacking libice-dev:amd64 (2:1.0.10-0ubuntu1) ... Selecting previously unselected package libpthread-stubs0-dev:amd64. Preparing to unpack .../10-libpthread-stubs0-dev_0.4-1_amd64.deb ... Unpacking libpthread-stubs0-dev:amd64 (0.4-1) ... Selecting previously unselected package libsm-dev:amd64. Preparing to unpack .../11-libsm-dev_2%3a1.2.3-1_amd64.deb ... Unpacking libsm-dev:amd64 (2:1.2.3-1) ... Selecting previously unselected package libxau-dev:amd64. Preparing to unpack .../12-libxau-dev_1%3a1.0.9-0ubuntu1_amd64.deb ... Unpacking libxau-dev:amd64 (1:1.0.9-0ubuntu1) ... Selecting previously unselected package libxdmcp-dev:amd64. Preparing to unpack .../13-libxdmcp-dev_1%3a1.1.3-0ubuntu1_amd64.deb ... Unpacking libxdmcp-dev:amd64 (1:1.1.3-0ubuntu1) ... Selecting previously unselected package xtrans-dev. Preparing to unpack .../14-xtrans-dev_1.4.0-1_all.deb ... Unpacking xtrans-dev (1.4.0-1) ... Selecting previously unselected package libxcb1-dev:amd64. Preparing to unpack .../15-libxcb1-dev_1.14-2_amd64.deb ... Unpacking libxcb1-dev:amd64 (1.14-2) ... Selecting previously unselected package libx11-dev:amd64. Preparing to unpack .../16-libx11-dev_2%3a1.6.9-2ubuntu1.2_amd64.deb ... Unpacking libx11-dev:amd64 (2:1.6.9-2ubuntu1.2) ... Selecting previously unselected package libxt-dev:amd64. Preparing to unpack .../17-libxt-dev_1%3a1.1.5-1_amd64.deb ... Unpacking libxt-dev:amd64 (1:1.1.5-1) ... Selecting previously unselected package openjdk-8-jre:amd64. Preparing to unpack .../18-openjdk-8-jre_8u312-b07-0ubuntu1~20.04_amd64.deb ... Unpacking openjdk-8-jre:amd64 (8u312-b07-0ubuntu1~20.04) ... Selecting previously unselected package openjdk-8-jdk-headless:amd64. Preparing to unpack .../19-openjdk-8-jdk-headless_8u312-b07-0ubuntu1~20.04_amd64.deb ... Unpacking openjdk-8-jdk-headless:amd64 (8u312-b07-0ubuntu1~20.04) ... Selecting previously unselected package openjdk-8-jdk:amd64. Preparing to unpack .../20-openjdk-8-jdk_8u312-b07-0ubuntu1~20.04_amd64.deb ... Unpacking openjdk-8-jdk:amd64 (8u312-b07-0ubuntu1~20.04) ... Setting up java-common (0.72) ... Setting up libpthread-stubs0-dev:amd64 (0.4-1) ... Setting up xtrans-dev (1.4.0-1) ... Setting up fonts-dejavu-extra (2.37-1) ... Setting up xorg-sgml-doctools (1:1.11-1) ... Setting up libatk-wrapper-java (0.37.1-1) ... Setting up libatk-wrapper-java-jni:amd64 (0.37.1-1) ... Setting up openjdk-8-jre-headless:amd64 (8u312-b07-0ubuntu1~20.04) ... update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/rmid to provide /usr/bin/rmid (rmid) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java to provide /usr/bin/java (java) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/keytool to provide /usr/bin/keytool (keytool) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/jjs to provide /usr/bin/jjs (jjs) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/pack200 to provide /usr/bin/pack200 (pack200) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/rmiregistry to provide /usr/bin/rmiregistry (rmiregistry) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/unpack200 to provide /usr/bin/unpack200 (unpack200) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/orbd to provide /usr/bin/orbd (orbd) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/servertool to provide /usr/bin/servertool (servertool) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/tnameserv to provide /usr/bin/tnameserv (tnameserv) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jexec to provide /usr/bin/jexec (jexec) in auto mode Setting up ca-certificates-java (20190405ubuntu1) ... head: cannot open '/etc/ssl/certs/java/cacerts' for reading: No such file or directory Adding debian:QuoVadis_Root_CA_2_G3.pem Adding debian:DigiCert_Assured_ID_Root_CA.pem Adding debian:Staat_der_Nederlanden_Root_CA_-_G3.pem Adding debian:TWCA_Global_Root_CA.pem Adding debian:Entrust_Root_Certification_Authority.pem Adding debian:T-TeleSec_GlobalRoot_Class_2.pem Adding debian:emSign_Root_CA_-_C1.pem Adding debian:Certum_Trusted_Network_CA_2.pem Adding debian:Comodo_AAA_Services_root.pem Adding debian:Entrust_Root_Certification_Authority_-_G2.pem Adding debian:Hellenic_Academic_and_Research_Institutions_RootCA_2011.pem Adding debian:DigiCert_Global_Root_G2.pem Adding debian:Entrust_Root_Certification_Authority_-_G4.pem Adding debian:SwissSign_Gold_CA_-_G2.pem Adding debian:AffirmTrust_Commercial.pem Adding debian:QuoVadis_Root_CA_2.pem Adding debian:certSIGN_Root_CA_G2.pem Adding debian:Microsec_e-Szigno_Root_CA_2009.pem Adding debian:SSL.com_Root_Certification_Authority_ECC.pem Adding debian:Go_Daddy_Root_Certificate_Authority_-_G2.pem Adding debian:Hellenic_Academic_and_Research_Institutions_ECC_RootCA_2015.pem Adding debian:DigiCert_High_Assurance_EV_Root_CA.pem Adding debian:Amazon_Root_CA_1.pem Adding debian:Security_Communication_RootCA2.pem Adding debian:Hellenic_Academic_and_Research_Institutions_RootCA_2015.pem Adding debian:TrustCor_RootCert_CA-1.pem Adding debian:Global_Chambersign_Root_-_2008.pem Adding debian:UCA_Extended_Validation_Root.pem Adding debian:ACCVRAIZ1.pem Adding debian:SecureSign_RootCA11.pem Adding debian:emSign_ECC_Root_CA_-_C3.pem Adding debian:Starfield_Root_Certificate_Authority_-_G2.pem Adding debian:TUBITAK_Kamu_SM_SSL_Kok_Sertifikasi_-_Surum_1.pem Adding debian:VeriSign_Universal_Root_Certification_Authority.pem Adding debian:D-TRUST_Root_Class_3_CA_2_2009.pem Adding debian:ISRG_Root_X1.pem Adding debian:COMODO_RSA_Certification_Authority.pem Adding debian:Certigna_Root_CA.pem Adding debian:Entrust.net_Premium_2048_Secure_Server_CA.pem Adding debian:GlobalSign_Root_CA_-_R3.pem Adding debian:Certigna.pem Adding debian:Microsoft_ECC_Root_Certificate_Authority_2017.pem Adding debian:Hongkong_Post_Root_CA_3.pem Adding debian:SZAFIR_ROOT_CA2.pem Adding debian:Baltimore_CyberTrust_Root.pem Adding debian:Buypass_Class_2_Root_CA.pem Adding debian:Go_Daddy_Class_2_CA.pem Adding debian:USERTrust_RSA_Certification_Authority.pem Adding debian:D-TRUST_Root_Class_3_CA_2_EV_2009.pem Adding debian:AffirmTrust_Networking.pem Adding debian:Microsoft_RSA_Root_Certificate_Authority_2017.pem Adding debian:Trustwave_Global_ECC_P384_Certification_Authority.pem Adding debian:Trustis_FPS_Root_CA.pem Adding debian:DigiCert_Trusted_Root_G4.pem Adding debian:Amazon_Root_CA_3.pem Adding debian:GlobalSign_ECC_Root_CA_-_R4.pem Adding debian:Chambers_of_Commerce_Root_-_2008.pem Adding debian:GTS_Root_R2.pem Adding debian:DigiCert_Assured_ID_Root_G2.pem Adding debian:Atos_TrustedRoot_2011.pem Adding debian:E-Tugra_Certification_Authority.pem Adding debian:SSL.com_EV_Root_Certification_Authority_ECC.pem Adding debian:QuoVadis_Root_CA.pem Adding debian:CA_Disig_Root_R2.pem Adding debian:GeoTrust_Primary_Certification_Authority_-_G2.pem Adding debian:Entrust_Root_Certification_Authority_-_EC1.pem Adding debian:Starfield_Services_Root_Certificate_Authority_-_G2.pem Adding debian:emSign_Root_CA_-_G1.pem Adding debian:GlobalSign_Root_CA_-_R6.pem Adding debian:IdenTrust_Commercial_Root_CA_1.pem Adding debian:GTS_Root_R3.pem Adding debian:SSL.com_EV_Root_Certification_Authority_RSA_R2.pem Adding debian:emSign_ECC_Root_CA_-_G3.pem Adding debian:DigiCert_Assured_ID_Root_G3.pem Adding debian:NetLock_Arany_=Class_Gold=_Főtanúsítvány.pem Adding debian:XRamp_Global_CA_Root.pem Adding debian:IdenTrust_Public_Sector_Root_CA_1.pem Adding debian:Staat_der_Nederlanden_EV_Root_CA.pem Adding debian:Hongkong_Post_Root_CA_1.pem Adding debian:Actalis_Authentication_Root_CA.pem Adding debian:Trustwave_Global_Certification_Authority.pem Adding debian:GTS_Root_R1.pem Adding debian:Secure_Global_CA.pem Adding debian:Izenpe.com.pem Adding debian:UCA_Global_G2_Root.pem Adding debian:AC_RAIZ_FNMT-RCM.pem Adding debian:QuoVadis_Root_CA_3_G3.pem Adding debian:TrustCor_RootCert_CA-2.pem Adding debian:ssl-cert-snakeoil.pem Adding debian:SSL.com_Root_Certification_Authority_RSA.pem Adding debian:Cybertrust_Global_Root.pem Adding debian:COMODO_Certification_Authority.pem Adding debian:Certum_Trusted_Network_CA.pem Adding debian:Starfield_Class_2_CA.pem Adding debian:CFCA_EV_ROOT.pem Adding debian:GlobalSign_ECC_Root_CA_-_R5.pem Adding debian:DigiCert_Global_Root_CA.pem Adding debian:GDCA_TrustAUTH_R5_ROOT.pem Adding debian:USERTrust_ECC_Certification_Authority.pem Adding debian:T-TeleSec_GlobalRoot_Class_3.pem Adding debian:Sonera_Class_2_Root_CA.pem Adding debian:OISTE_WISeKey_Global_Root_GC_CA.pem Adding debian:TeliaSonera_Root_CA_v1.pem Adding debian:ePKI_Root_Certification_Authority.pem Adding debian:SecureTrust_CA.pem Adding debian:AffirmTrust_Premium.pem Adding debian:certSIGN_ROOT_CA.pem Adding debian:EC-ACC.pem Adding debian:AffirmTrust_Premium_ECC.pem Adding debian:TrustCor_ECA-1.pem Adding debian:QuoVadis_Root_CA_1_G3.pem Adding debian:Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.pem Adding debian:Amazon_Root_CA_4.pem Adding debian:GlobalSign_Root_CA_-_R2.pem Adding debian:GTS_Root_R4.pem Adding debian:DigiCert_Global_Root_G3.pem Adding debian:TWCA_Root_Certification_Authority.pem Adding debian:Buypass_Class_3_Root_CA.pem Adding debian:Amazon_Root_CA_2.pem Adding debian:Network_Solutions_Certificate_Authority.pem Adding debian:Security_Communication_Root_CA.pem Adding debian:Trustwave_Global_ECC_P256_Certification_Authority.pem Adding debian:e-Szigno_Root_CA_2017.pem Adding debian:OISTE_WISeKey_Global_Root_GB_CA.pem Adding debian:NAVER_Global_Root_Certification_Authority.pem Adding debian:DST_Root_CA_X3.pem Adding debian:COMODO_ECC_Certification_Authority.pem Adding debian:SwissSign_Silver_CA_-_G2.pem Adding debian:GlobalSign_Root_CA.pem Adding debian:QuoVadis_Root_CA_3.pem done. Setting up openjdk-8-jre:amd64 (8u312-b07-0ubuntu1~20.04) ... update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/policytool to provide /usr/bin/policytool (policytool) in auto mode Setting up openjdk-8-jdk-headless:amd64 (8u312-b07-0ubuntu1~20.04) ... update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/idlj to provide /usr/bin/idlj (idlj) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jdeps to provide /usr/bin/jdeps (jdeps) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/wsimport to provide /usr/bin/wsimport (wsimport) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/rmic to provide /usr/bin/rmic (rmic) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jinfo to provide /usr/bin/jinfo (jinfo) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jsadebugd to provide /usr/bin/jsadebugd (jsadebugd) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/native2ascii to provide /usr/bin/native2ascii (native2ascii) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jstat to provide /usr/bin/jstat (jstat) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/javac to provide /usr/bin/javac (javac) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/javah to provide /usr/bin/javah (javah) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/hsdb to provide /usr/bin/hsdb (hsdb) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/clhsdb to provide /usr/bin/clhsdb (clhsdb) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jps to provide /usr/bin/jps (jps) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jstack to provide /usr/bin/jstack (jstack) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jrunscript to provide /usr/bin/jrunscript (jrunscript) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/javadoc to provide /usr/bin/javadoc (javadoc) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/javap to provide /usr/bin/javap (javap) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jar to provide /usr/bin/jar (jar) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/xjc to provide /usr/bin/xjc (xjc) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/schemagen to provide /usr/bin/schemagen (schemagen) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/extcheck to provide /usr/bin/extcheck (extcheck) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jmap to provide /usr/bin/jmap (jmap) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jstatd to provide /usr/bin/jstatd (jstatd) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jhat to provide /usr/bin/jhat (jhat) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jdb to provide /usr/bin/jdb (jdb) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/serialver to provide /usr/bin/serialver (serialver) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jfr to provide /usr/bin/jfr (jfr) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/wsgen to provide /usr/bin/wsgen (wsgen) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jcmd to provide /usr/bin/jcmd (jcmd) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jarsigner to provide /usr/bin/jarsigner (jarsigner) in auto mode Setting up openjdk-8-jdk:amd64 (8u312-b07-0ubuntu1~20.04) ... update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/appletviewer to provide /usr/bin/appletviewer (appletviewer) in auto mode update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jconsole to provide /usr/bin/jconsole (jconsole) in auto mode Processing triggers for fontconfig (2.13.1-2ubuntu3) ... Processing triggers for desktop-file-utils (0.24-1ubuntu3) ... Processing triggers for mime-support (3.64ubuntu1) ... Processing triggers for hicolor-icon-theme (0.17-2) ... Processing triggers for gnome-menus (3.36.0-1ubuntu1) ... Processing triggers for libc-bin (2.31-0ubuntu9.2) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for ca-certificates (20210119~20.04.1) ... Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done. Running hooks in /etc/ca-certificates/update.d... done. done. Processing triggers for sgml-base (1.29.1) ... Setting up x11proto-dev (2019.2-1ubuntu1) ... Setting up libxau-dev:amd64 (1:1.0.9-0ubuntu1) ... Setting up libice-dev:amd64 (2:1.0.10-0ubuntu1) ... Setting up libsm-dev:amd64 (2:1.2.3-1) ... Setting up libxdmcp-dev:amd64 (1:1.1.3-0ubuntu1) ... Setting up x11proto-core-dev (2019.2-1ubuntu1) ... Setting up libxcb1-dev:amd64 (1.14-2) ... Setting up libx11-dev:amd64 (2:1.6.9-2ubuntu1.2) ... Setting up libxt-dev:amd64 (1:1.1.5-1) ...
安装完成,使用 java -version
命令验证 OpenJDK 是否安装成功:
$ java -version
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-8u312-b07-0ubuntu1~20.04-b07)
OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。