{"id":5266,"date":"2019-12-07T12:35:25","date_gmt":"2019-12-07T07:05:25","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=5266"},"modified":"2019-12-07T13:14:11","modified_gmt":"2019-12-07T07:44:11","slug":"how-to-remove-install-oracle-java-jdk-in-ubuntu-16-0-4","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-remove-install-oracle-java-jdk-in-ubuntu-16-0-4\/","title":{"rendered":"How to remove &amp; install oracle java [Jdk] in ubuntu 16.0.4"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">How to remove &amp; install oracle java [Jdk] in ubuntu 16.0.4<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Date published: 07-12-2019<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Java is a very popular programming language for a system web application, software development, Android development and so on. Therefore, we need to install the Java Development Kit [JDK] and Java Runtime Environment [JRE] to configure the Java development environment. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For instance, this blog article will guide you to remove older JDK 8 and to install Oracle Java 11 LTS version on <strong>Ubuntu 16.04 <\/strong>LTS Xenial system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Subsequently, you can follow up the instructions given below(one-by-one) from the terminal <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">To remove&nbsp;<strong>Oracle JDK<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To remove&nbsp;<strong>Oracle JDK<\/strong>&nbsp;completely, here are the guidelines to do:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Check which JDK packages are installed<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dpkg --list | grep -i jdk<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>In the same vein, remove Oracle Java 8 completely.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get purge oracle-java8-installer <\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get autoremove<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Check that all JDK packages have been removed<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dpkg --list | grep -i jdk<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then if you want to, you can also purge the PPA<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Action 1 \u2013  Update the current packages<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Most importantly update the current packages installed. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\n\nsudo apt upgrade <\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Action 2 \u2013 Install Java  JDK11 in Ubuntu 16.04 LTS<\/h3>\n\n\n\n<figure class=\"wp-block-gallery columns-1 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img fetchpriority=\"high\" decoding=\"async\" width=\"473\" height=\"358\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/jdk_jre_jvm.png\" alt=\"\" data-id=\"5271\" data-full-url=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/jdk_jre_jvm.png\" data-link=\"https:\/\/pheonixsolutions.com\/blog\/how-to-remove-install-oracle-java-jdk-in-ubuntu-16-0-4\/jdk_jre_jvm\/\" class=\"wp-image-5271\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/jdk_jre_jvm.png 473w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/12\/jdk_jre_jvm-300x227.png 300w\" sizes=\"(max-width: 473px) 100vw, 473px\" \/><\/figure><\/li><\/ul><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">JDK compiled the source java file and make a java class file. JRE is used to run that intermediate class file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Moreover, we need to add the following PPA to your Ubuntu server environment. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This Personal Package Archive (PPA) contains a package oracle-java11-installer having the Java installation script. The command to be executed in terminal as follows,<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo add-apt-repository ppa:linuxuprising\/java\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"> To sum up, this below script downloads the Java archive from the official site and configures it on your system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Certainly, install Java 11 using the script provided in these packages.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\n\nsudo apt-get install oracle-java11-installer\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">As a result, install the following package to configure Java 11 as <strong>default Java version<\/strong> on your Ubuntu 16 \/ 18 server system.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install oracle-java11-set-default<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Action 3 \u2013 Verify Java Version and proceed with your work<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Check the installed Java version on your system<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">java -version\n\njava version \"11.0.2\" 2019-01-15 LTS\nJava(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)\nJava HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, you have successfully installed Java 11 on Ubuntu 16.04 LTS system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks for using&nbsp;<a href=\"https:\/\/pheonixsolutions.com\/\">pheonix solutions<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to remove &amp; install oracle java [Jdk] in ubuntu 16.0.4 Date published: 07-12-2019 Java is a very popular programming [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1019],"tags":[732],"class_list":["post-5266","post","type-post","status-publish","format-standard","hentry","category-cloud-aws","tag-remove-jdk-8-in-ubuntu-16-0-4-and-install-jdk-11-in-ubuntu-16-0-4","psol-cat-cloud-aws"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-1mW","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=5266"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5266\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=5266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=5266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=5266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}