卸载 Ubuntu 上的 open-jdk 并安装 oracle-jdk8

一般Ubuntu上面会自带有默认的open-jdk,但我们一般不希望使用这个版本,卸载起来的话也很简单,一条命令即可解决。

卸载openjdk

1. 输入命令:

sudo apt-get purge openjdk*

2. 控制台输出信息:

hadoop@chenxlPC:/mnt/d/presto$ sudo apt-get purge openjdk*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'openjdk-9-jre-headless' for glob 'openjdk*'
Note, selecting 'openjdk-8-jdk' for glob 'openjdk*'
Note, selecting 'openjdk-8-jre' for glob 'openjdk*'
Note, selecting 'openjdk-6-jdk' for glob 'openjdk*'
Note, selecting 'openjdk-6-jre' for glob 'openjdk*'
Note, selecting 'openjdk-9-demo' for glob 'openjdk*'
Note, selecting 'openjdk-6-jre-headless' for glob 'openjdk*'
Note, selecting 'openjdk-8-demo' for glob 'openjdk*'
Note, selecting 'openjdk-8-jre-dcevm' for glob 'openjdk*'
Note, selecting 'openjdk-8-jdk-headless' for glob 'openjdk*'
Note, selecting 'openjdk-9-dbg' for glob 'openjdk*'
Note, selecting 'openjdk-7-jre-headless' for glob 'openjdk*'
Note, selecting 'openjdk-9-doc' for glob 'openjdk*'
Note, selecting 'openjdk-8-jre-zero' for glob 'openjdk*'
Note, selecting 'openjdk-8-source' for glob 'openjdk*'
Note, selecting 'openjdk-jre' for glob 'openjdk*'
Note, selecting 'openjdk-9-jdk' for glob 'openjdk*'
Note, selecting 'openjdk-9-jre' for glob 'openjdk*'
Note, selecting 'openjdk-7-jdk' for glob 'openjdk*'
Note, selecting 'openjdk-7-jre' for glob 'openjdk*'
Note, selecting 'openjdk-9-jdk-headless' for glob 'openjdk*'
Note, selecting 'openjdk-8-jre-headless' for glob 'openjdk*'
Note, selecting 'openjdk-9-source' for glob 'openjdk*'
Note, selecting 'openjdk-8-jre-jamvm' for glob 'openjdk*'
Note, selecting 'openjdk-8-dbg' for glob 'openjdk*'
Note, selecting 'openjdk-8-doc' for glob 'openjdk*'
Package 'openjdk-6-jdk' is not installed, so not removed
Package 'openjdk-jre' is not installed, so not removed
Package 'openjdk-8-jre-dcevm' is not installed, so not removed
Package 'openjdk-9-dbg' is not installed, so not removed
Package 'openjdk-9-demo' is not installed, so not removed
Package 'openjdk-9-doc' is not installed, so not removed
Package 'openjdk-9-jdk' is not installed, so not removed
Package 'openjdk-9-jdk-headless' is not installed, so not removed
Package 'openjdk-9-jre' is not installed, so not removed
Package 'openjdk-9-jre-headless' is not installed, so not removed
Package 'openjdk-9-source' is not installed, so not removed
Package 'openjdk-8-dbg' is not installed, so not removed
Package 'openjdk-8-demo' is not installed, so not removed
Package 'openjdk-8-doc' is not installed, so not removed
Package 'openjdk-8-jdk' is not installed, so not removed
Package 'openjdk-8-jdk-headless' is not installed, so not removed
Package 'openjdk-8-jre' is not installed, so not removed
Package 'openjdk-8-jre-jamvm' is not installed, so not removed
Package 'openjdk-8-source' is not installed, so not removed
Package 'openjdk-8-jre-zero' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  java-common junit libaopalliance-java libapache-pom-java libasm4-java libatinject-jsr330-api-java libbsh-java
  libcdi-api-java libcglib3-java libclassworlds-java libcommons-cli-java libcommons-codec-java
  libcommons-httpclient-java libcommons-io-java libcommons-lang-java libcommons-lang3-java libcommons-logging-java
  libcommons-net-java libcommons-net2-java libcommons-parent-java libdom4j-java libdoxia-core-java
  libeclipse-aether-java libgeronimo-interceptor-3.0-spec-java libguava-java libguice-java libhamcrest-java
  libhttpclient-java libhttpcore-java libjaxen-java libjaxp1.3-java libjdom1-java libjetty-java libjsch-java
  libjsoup-java libjsr305-java liblog4j1.2-java libmaven-parent-java libmaven2-core-java libnspr4 libnss3
  libnss3-nssdb libobjenesis-java libplexus-ant-factory-java libplexus-archiver-java libplexus-bsh-factory-java
  libplexus-cipher-java libplexus-classworlds-java libplexus-classworlds2-java libplexus-cli-java
  libplexus-component-annotations-java libplexus-component-metadata-java libplexus-container-default-java
  libplexus-container-default1.5-java libplexus-containers-java libplexus-containers1.5-java
  libplexus-interactivity-api-java libplexus-interpolation-java libplexus-io-java libplexus-sec-dispatcher-java
  libplexus-utils-java libplexus-utils2-java libqdox2-java libservlet2.5-java libservlet3.1-java libsisu-inject-java
  libsisu-plexus-java libslf4j-java libwagon-java libxalan2-java libxbean-java libxerces2-java
  libxml-commons-external-java libxml-commons-resolver1.1-java libxom-java libxpp2-java libxpp3-java
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  ant* ant-optional* ca-certificates-java* default-jre-headless* junit4* libeasymock-java* libmaven3-core-java*
  libwagon2-java* maven* openjdk-8-jre-headless*
0 upgraded, 0 newly installed, 10 to remove and 114 not upgraded.
1 not fully installed or removed.
After this operation, 108 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 57357 files and directories currently installed.)
Removing maven (3.3.9-3) ...
Purging configuration files for maven (3.3.9-3) ...
Removing ant-optional (1.9.6-1ubuntu1) ...
Removing ant (1.9.6-1ubuntu1) ...
Removing libmaven3-core-java (3.3.9-3) ...
Removing libwagon2-java (2.10-3) ...
Removing libeasymock-java (3.3.1+ds-3) ...
Removing junit4 (4.12-4ubuntu1) ...
Removing default-jre-headless (2:1.8-56ubuntu2) ...
Removing openjdk-8-jre-headless:amd64 (8u131-b11-2ubuntu1.16.04.3) ...
Purging configuration files for openjdk-8-jre-headless:amd64 (8u131-b11-2ubuntu1.16.04.3) ...
Removing ca-certificates-java (20160321) ...
Purging configuration files for ca-certificates-java (20160321) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for ca-certificates (20160104ubuntu1) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.

3. 验证是否卸载成功

hadoop@chenxlPC:/mnt/d/presto$ java -version
bash: /usr/bin/java: No such file or directory

安装oracle-jdk

1. 添加oracle-jdk的源并更新

sudo add-apt-repository ppa:webupd8team/java

sudo apt-get update

2. 安装oracle-jdk

sudo apt-get install oracle-java8-installer

3. 输出信息

hadoop@chenxlPC:/mnt/d/presto$ sudo apt-get install oracle-java8-installer
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  junit libaopalliance-java libapache-pom-java libasm4-java libatinject-jsr330-api-java libbsh-java libcdi-api-java libcglib3-java libclassworlds-java libcommons-cli-java libcommons-codec-java libcommons-httpclient-java libcommons-io-java
  libcommons-lang-java libcommons-lang3-java libcommons-logging-java libcommons-net-java libcommons-net2-java libcommons-parent-java libdom4j-java libdoxia-core-java libeclipse-aether-java libgeronimo-interceptor-3.0-spec-java libguava-java
  libguice-java libhamcrest-java libhttpclient-java libhttpcore-java libjaxen-java libjaxp1.3-java libjdom1-java libjetty-java libjsch-java libjsoup-java libjsr305-java liblog4j1.2-java libmaven-parent-java libmaven2-core-java libnspr4 libnss3
  libnss3-nssdb libobjenesis-java libplexus-ant-factory-java libplexus-archiver-java libplexus-bsh-factory-java libplexus-cipher-java libplexus-classworlds-java libplexus-classworlds2-java libplexus-cli-java libplexus-component-annotations-java
  libplexus-component-metadata-java libplexus-container-default-java libplexus-container-default1.5-java libplexus-containers-java libplexus-containers1.5-java libplexus-interactivity-api-java libplexus-interpolation-java libplexus-io-java
  libplexus-sec-dispatcher-java libplexus-utils-java libplexus-utils2-java libqdox2-java libservlet2.5-java libservlet3.1-java libsisu-inject-java libsisu-plexus-java libslf4j-java libwagon-java libxalan2-java libxbean-java libxerces2-java
  libxml-commons-external-java libxml-commons-resolver1.1-java libxom-java libxpp2-java libxpp3-java
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  gsfonts gsfonts-x11 oracle-java8-set-default
Suggested packages:
  binfmt-support visualvm ttf-baekmuk | ttf-unfonts | ttf-unfonts-core ttf-kochi-gothic | ttf-sazanami-gothic ttf-kochi-mincho | ttf-sazanami-mincho ttf-arphic-uming
The following NEW packages will be installed:
  gsfonts gsfonts-x11 oracle-java8-installer oracle-java8-set-default
0 upgraded, 4 newly installed, 0 to remove and 114 not upgraded.
Need to get 39.6 kB/3,421 kB of archives.
After this operation, 5,115 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial/main amd64 oracle-java8-installer all 8u144-1~webupd8~0 [32.9 kB]
Get:2 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial/main amd64 oracle-java8-set-default all 8u144-1~webupd8~0 [6,738 B]
Fetched 39.6 kB in 34s (1,138 B/s)
Preconfiguring packages ...
Selecting previously unselected package oracle-java8-installer.
(Reading database ... 56587 files and directories currently installed.)
Preparing to unpack .../oracle-java8-installer_8u144-1~webupd8~0_all.deb ...
Unpacking oracle-java8-installer (8u144-1~webupd8~0) ...
Processing triggers for shared-mime-info (1.5-2ubuntu0.1) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Setting up oracle-java8-installer (8u144-1~webupd8~0) ...
No /var/cache/oracle-jdk8-installer/wgetrc file found.
Creating /var/cache/oracle-jdk8-installer/wgetrc and
using default oracle-java8-installer wgetrc settings for it.
Downloading Oracle Java 8...
--2017-08-28 18:13:10--  http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz
Resolving download.oracle.com (download.oracle.com)... 65.200.22.48, 65.200.22.33
Connecting to download.oracle.com (download.oracle.com)|65.200.22.48|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz [following]
--2017-08-28 18:13:11--  https://edelivery.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.199.156.152, 2600:1417:9:28c::2d3e, 2600:1417:9:28d::2d3e
Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.199.156.152|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz?AuthParam=1503915311_18022ba8360542c2e4da46a6fed5d49d [following]
--2017-08-28 18:13:11--  http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz?AuthParam=1503915311_18022ba8360542c2e4da46a6fed5d49d
Connecting to download.oracle.com (download.oracle.com)|65.200.22.48|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 185515842 (177M) [application/x-gzip]
Saving to: ‘jdk-8u144-linux-x64.tar.gz’

     0K ........ ........ ........ ........ ........ ........  1% 1.04M 2m47s
  3072K ........ ........ ........ ........ ........ ........  3% 1.36M 2m25s
  6144K ........ ........ ........ ........ ........ ........  5% 1.18M 2m22s
  9216K ........ ........ ........ ........ ........ ........  6%  973K 2m28s
 12288K ........ ........ ........ ........ ........ ........  8%  979K 2m30s
 15360K ........ ........ ........ ........ ........ ........ 10% 1.22M 2m25s
 18432K ........ ........ ........ ........ ........ ........ 11% 1.38M 2m18s
 21504K ........ ........ ........ ........ ........ ........ 13% 1.31M 2m13s
 24576K ........ ........ ........ ........ ........ ........ 15% 1.14M 2m11s
 27648K ........ ........ ........ ........ ........ ........ 16% 1.30M 2m6s
 30720K ........ ........ ........ ........ ........ ........ 18% 1.63M 2m1s
 33792K ........ ........ ........ ........ ........ ........ 20% 1.62M 1m56s
 36864K ........ ........ ........ ........ ........ ........ 22% 1.88M 1m50s
 39936K ........ ........ ........ ........ ........ ........ 23% 1.39M 1m47s
 43008K ........ ........ ........ ........ ........ ........ 25% 1.74M 1m43s
 46080K ........ ........ ........ ........ ........ ........ 27% 1.58M 99s
 49152K ........ ........ ........ ........ ........ ........ 28% 1.41M 96s
 52224K ........ ........ ........ ........ ........ ........ 30% 1.46M 93s
 55296K ........ ........ ........ ........ ........ ........ 32% 1.72M 90s
 58368K ........ ........ ........ ........ ........ ........ 33% 1.61M 87s
 61440K ........ ........ ........ ........ ........ ........ 35% 1.64M 84s
 64512K ........ ........ ........ ........ ........ ........ 37% 1.81M 81s
 67584K ........ ........ ........ ........ ........ ........ 39% 1.93M 78s
 70656K ........ ........ ........ ........ ........ ........ 40% 1.77M 75s
 73728K ........ ........ ........ ........ ........ ........ 42% 1.76M 72s
 76800K ........ ........ ........ ........ ........ ........ 44% 1.78M 70s
 79872K ........ ........ ........ ........ ........ ........ 45% 1.52M 67s
 82944K ........ ........ ........ ........ ........ ........ 47% 1.54M 65s
 86016K ........ ........ ........ ........ ........ ........ 49% 1.46M 63s
 89088K ........ ........ ........ ........ ........ ........ 50% 1.52M 61s
 92160K ........ ........ ........ ........ ........ ........ 52% 1.63M 58s
 95232K ........ ........ ........ ........ ........ ........ 54% 1.92M 56s
 98304K ........ ........ ........ ........ ........ ........ 55% 1.73M 53s
101376K ........ ........ ........ ........ ........ ........ 57% 1.44M 51s
104448K ........ ........ ........ ........ ........ ........ 59% 1.44M 49s
107520K ........ ........ ........ ........ ........ ........ 61% 1.63M 47s
110592K ........ ........ ........ ........ ........ ........ 62% 1.82M 45s
113664K ........ ........ ........ ........ ........ ........ 64% 1.53M 43s
116736K ........ ........ ........ ........ ........ ........ 66% 1.40M 41s
119808K ........ ........ ........ ........ ........ ........ 67% 1.79M 39s
122880K ........ ........ ........ ........ ........ ........ 69% 1.89M 36s
125952K ........ ........ ........ ........ ........ ........ 71% 1.86M 34s
129024K ........ ........ ........ ........ ........ ........ 72% 1.95M 32s
132096K ........ ........ ........ ........ ........ ........ 74% 1.88M 30s
135168K ........ ........ ........ ........ ........ ........ 76% 1.85M 28s
138240K ........ ........ ........ ........ ........ ........ 78% 1.57M 26s
141312K ........ ........ ........ ........ ........ ........ 79% 1.29M 24s
144384K ........ ........ ........ ........ ........ ........ 81%  947K 22s
147456K ........ ........ ........ ........ ........ ........ 83% 1.17M 20s
150528K ........ ........ ........ ........ ........ ........ 84% 1.57M 18s
153600K ........ ........ ........ ........ ........ ........ 86% 1.52M 16s
156672K ........ ........ ........ ........ ........ ........ 88% 1.48M 14s
159744K ........ ........ ........ ........ ........ ........ 89% 1.66M 12s
162816K ........ ........ ........ ........ ........ ........ 91% 1.80M 10s
165888K ........ ........ ........ ........ ........ ........ 93% 1.59M 8s
168960K ........ ........ ........ ........ ........ ........ 94% 1.57M 6s
172032K ........ ........ ........ ........ ........ ........ 96% 1.72M 4s
175104K ........ ........ ........ ........ ........ ........ 98% 1.65M 2s
178176K ........ ........ ........ ........ ........ ......  100% 1.91M=1m58s

2017-08-28 18:15:09 (1.50 MB/s) - ‘jdk-8u144-linux-x64.tar.gz’ saved [185515842/185515842]

Download done.
Removing outdated cached downloads...
update-alternatives: error: no alternatives for java
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/ControlPanel to provide /usr/bin/ControlPanel (ControlPanel) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/java to provide /usr/bin/java (java) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/javaws to provide /usr/bin/javaws (javaws) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/jcontrol to provide /usr/bin/jcontrol (jcontrol) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/jjs to provide /usr/bin/jjs (jjs) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/keytool to provide /usr/bin/keytool (keytool) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/orbd to provide /usr/bin/orbd (orbd) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/pack200 to provide /usr/bin/pack200 (pack200) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/policytool to provide /usr/bin/policytool (policytool) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/rmid to provide /usr/bin/rmid (rmid) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/rmiregistry to provide /usr/bin/rmiregistry (rmiregistry) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/servertool to provide /usr/bin/servertool (servertool) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/tnameserv to provide /usr/bin/tnameserv (tnameserv) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/unpack200 to provide /usr/bin/unpack200 (unpack200) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/lib/jexec to provide /usr/bin/jexec (jexec) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/appletviewer to provide /usr/bin/appletviewer (appletviewer) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/extcheck to provide /usr/bin/extcheck (extcheck) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/idlj to provide /usr/bin/idlj (idlj) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jar to provide /usr/bin/jar (jar) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jarsigner to provide /usr/bin/jarsigner (jarsigner) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javac to provide /usr/bin/javac (javac) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javadoc to provide /usr/bin/javadoc (javadoc) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javafxpackager to provide /usr/bin/javafxpackager (javafxpackager) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javah to provide /usr/bin/javah (javah) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javap to provide /usr/bin/javap (javap) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javapackager to provide /usr/bin/javapackager (javapackager) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jcmd to provide /usr/bin/jcmd (jcmd) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jconsole to provide /usr/bin/jconsole (jconsole) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jdb to provide /usr/bin/jdb (jdb) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jdeps to provide /usr/bin/jdeps (jdeps) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jhat to provide /usr/bin/jhat (jhat) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jinfo to provide /usr/bin/jinfo (jinfo) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jmap to provide /usr/bin/jmap (jmap) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jmc to provide /usr/bin/jmc (jmc) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jps to provide /usr/bin/jps (jps) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jrunscript to provide /usr/bin/jrunscript (jrunscript) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jsadebugd to provide /usr/bin/jsadebugd (jsadebugd) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jstack to provide /usr/bin/jstack (jstack) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jstat to provide /usr/bin/jstat (jstat) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jstatd to provide /usr/bin/jstatd (jstatd) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jvisualvm to provide /usr/bin/jvisualvm (jvisualvm) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/native2ascii to provide /usr/bin/native2ascii (native2ascii) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/rmic to provide /usr/bin/rmic (rmic) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/schemagen to provide /usr/bin/schemagen (schemagen) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/serialver to provide /usr/bin/serialver (serialver) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/wsgen to provide /usr/bin/wsgen (wsgen) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/wsimport to provide /usr/bin/wsimport (wsimport) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/xjc to provide /usr/bin/xjc (xjc) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/lib/amd64/libnpjp2.so to provide /usr/lib/mozilla/plugins/libjavaplugin.so (mozilla-javaplugin.so) in auto mode
Oracle JDK 8 installed

#####Important########
To set Oracle JDK8 as default, install the "oracle-java8-set-default" package.
E.g.: sudo apt install oracle-java8-set-default
On Ubuntu systems, oracle-java8-set-default is most probably installed
automatically with this package.
######################

Selecting previously unselected package oracle-java8-set-default.
(Reading database ... 56618 files and directories currently installed.)
Preparing to unpack .../oracle-java8-set-default_8u144-1~webupd8~0_all.deb ...
Unpacking oracle-java8-set-default (8u144-1~webupd8~0) ...
Selecting previously unselected package gsfonts.
Preparing to unpack .../gsfonts_1%3a8.11+urwcyr1.0.7~pre44-4.2ubuntu1_all.deb ...
Unpacking gsfonts (1:8.11+urwcyr1.0.7~pre44-4.2ubuntu1) ...
Selecting previously unselected package gsfonts-x11.
Preparing to unpack .../gsfonts-x11_0.24_all.deb ...
Unpacking gsfonts-x11 (0.24) ...
Processing triggers for fontconfig (2.11.94-0ubuntu1.1) ...
Setting up oracle-java8-set-default (8u144-1~webupd8~0) ...
Setting up gsfonts (1:8.11+urwcyr1.0.7~pre44-4.2ubuntu1) ...
Setting up gsfonts-x11 (0.24) ...

4. 验证

hadoop@chenxlPC:/mnt/d/presto$ java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

参考

发表评论

电子邮件地址不会被公开。 必填项已用*标注