

{"id":4788,"date":"2017-11-09T06:15:58","date_gmt":"2017-11-09T00:45:58","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=4788"},"modified":"2026-05-05T15:28:52","modified_gmt":"2026-05-05T09:58:52","slug":"install-java-8-on-ubuntu","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/install-java-8-on-ubuntu\/","title":{"rendered":"Install Java 8 on Ubuntu &#8211; Step by Step Guide for Beginners"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:2193,&quot;href&quot;:&quot;https:\\\/\\\/www.oracle.com\\\/technetwork\\\/java\\\/javase\\\/downloads\\\/jdk8-downloads-2133151.html&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20200128044137\\\/https:\\\/\\\/www.oracle.com\\\/technetwork\\\/java\\\/javase\\\/downloads\\\/jdk8-downloads-2133151.html&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-11 02:20:42&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-01 10:45:09&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-21 07:51:21&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-01 10:12:36&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-16 10:05:40&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-26 08:32:40&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-01 13:14:21&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-08 11:25:35&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-08 11:25:35&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:1457,&quot;href&quot;:&quot;https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Java_(programming_language)&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251209074728\\\/https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Java_(programming_language)&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-11 07:13:11&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-15 05:49:22&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-18 07:11:43&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-25 19:19:23&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-01 10:45:23&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-04 18:11:25&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-09 14:35:11&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-13 08:39:47&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-18 13:17:22&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-21 22:42:22&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-26 19:12:21&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-31 07:20:51&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-08 11:50:52&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-12 11:00:16&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-16 05:47:52&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-22 16:13:14&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-25 18:35:28&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-02 13:34:50&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-06 12:14:26&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-09 17:12:49&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-19 16:12:32&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-24 23:57:08&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-28 17:06:40&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-09 10:03:04&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-14 22:21:21&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-18 15:35:05&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-23 22:58:29&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-28 17:30:38&quot;,&quot;http_code&quot;:429},{&quot;date&quot;:&quot;2026-05-02 04:30:26&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-06 09:46:06&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-11 11:47:37&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-14 18:28:55&quot;,&quot;http_code&quot;:429},{&quot;date&quot;:&quot;2026-05-19 00:49:57&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-26 08:32:44&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-01 01:19:45&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-06-08 11:25:39&quot;,&quot;http_code&quot;:404}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-08 11:25:39&quot;,&quot;http_code&quot;:404},&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<p><span style=\"font-weight: 400\">In this article, we will learn how to install Java 8 on Ubuntu OS. We will install JDK in Ubuntu. <strong><a href=\"https:\/\/data-flair.training\/blogs\/java-tutorial\/\" target=\"_blank\" rel=\"noopener\">Java is a programming language<\/a> <\/strong>which is actually developed by Sun Microsystems. Java is free to download and use for commercial purposes.<\/span><\/p>\n<p>So, let&#8217;s start with how to install Java 8 on Ubuntu.<\/p>\n<div id=\"attachment_42873\" style=\"width: 1210px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Install-Java-on-Ubuntu-01.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-42873\" class=\"size-full wp-image-42873\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Install-Java-on-Ubuntu-01.jpg\" alt=\"Install Java 8 on Ubuntu - Step by Step Guide for Beginners\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Install-Java-on-Ubuntu-01.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Install-Java-on-Ubuntu-01-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Install-Java-on-Ubuntu-01-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Install-Java-on-Ubuntu-01-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Install-Java-on-Ubuntu-01-1024x536.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Install-Java-on-Ubuntu-01-520x272.jpg 520w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><p id=\"caption-attachment-42873\" class=\"wp-caption-text\">Install Java 8 on Ubuntu &#8211; Step-by-Step Guide for Beginners<\/p><\/div>\n<h3>How to Install Java 8 on Ubuntu?<\/h3>\n<p>Here is the process of installing Java 8 on Ubuntu. Follow these steps one by one and start your journey as a programmer.<\/p>\n<p>Follow these steps to install Java 8:<\/p>\n<div id=\"attachment_4789\" style=\"width: 742px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/mkdir-img1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4789\" class=\"wp-image-4789 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/mkdir-img1.png\" alt=\"Install Java on Ubuntu01\" width=\"732\" height=\"438\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/mkdir-img1.png 732w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/mkdir-img1-150x90.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/mkdir-img1-300x180.png 300w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><\/a><p id=\"caption-attachment-4789\" class=\"wp-caption-text\">Step.1 Install Java on Ubuntu<\/p><\/div>\n<div id=\"attachment_4790\" style=\"width: 742px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/extracting-the-jdk-img2.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4790\" class=\"wp-image-4790 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/extracting-the-jdk-img2.png\" alt=\"Install Java on Ubuntu02\" width=\"732\" height=\"438\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/extracting-the-jdk-img2.png 732w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/extracting-the-jdk-img2-150x90.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/extracting-the-jdk-img2-300x180.png 300w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><\/a><p id=\"caption-attachment-4790\" class=\"wp-caption-text\">Step 2: Install Java on Ubuntu<\/p><\/div>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/install-java\/\" target=\"_blank\" rel=\"noopener\">Do you want to install Java in Windows &amp; Linux?<\/a><\/strong><\/p>\n<div id=\"attachment_4791\" style=\"width: 742px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/verifying-img3.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4791\" class=\"wp-image-4791 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/verifying-img3.png\" alt=\"Install Java on Ubuntu03\" width=\"732\" height=\"439\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/verifying-img3.png 732w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/verifying-img3-150x90.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/verifying-img3-300x180.png 300w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><\/a><p id=\"caption-attachment-4791\" class=\"wp-caption-text\">Step.3 Install Java on Ubuntu<\/p><\/div>\n<div id=\"attachment_4792\" style=\"width: 741px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/set-as-default-jvm-img4.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4792\" class=\"wp-image-4792 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/set-as-default-jvm-img4.png\" alt=\"Install Java on Ubuntu04\" width=\"731\" height=\"512\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/set-as-default-jvm-img4.png 731w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/set-as-default-jvm-img4-150x105.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/set-as-default-jvm-img4-300x210.png 300w\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" \/><\/a><p id=\"caption-attachment-4792\" class=\"wp-caption-text\">Step.4 Install Java on Ubuntu<\/p><\/div>\n<div id=\"attachment_4793\" style=\"width: 741px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/update-default-jvm-img5.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4793\" class=\"wp-image-4793 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/update-default-jvm-img5.png\" alt=\"Install Java on Ubuntu\" width=\"731\" height=\"503\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/update-default-jvm-img5.png 731w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/update-default-jvm-img5-150x103.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/update-default-jvm-img5-300x206.png 300w\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" \/><\/a><p id=\"caption-attachment-4793\" class=\"wp-caption-text\">Step.5 Install Java on Ubuntu<\/p><\/div>\n<div id=\"attachment_4794\" style=\"width: 737px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/verifying-the-installation-img6.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4794\" class=\"wp-image-4794 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/verifying-the-installation-img6.png\" alt=\"Install Java 8 on Ubuntu06\" width=\"727\" height=\"509\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/verifying-the-installation-img6.png 727w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/verifying-the-installation-img6-150x105.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/verifying-the-installation-img6-300x210.png 300w\" sizes=\"auto, (max-width: 727px) 100vw, 727px\" \/><\/a><p id=\"caption-attachment-4794\" class=\"wp-caption-text\">Step.6 Install Java 8 on Ubuntu<\/p><\/div>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/java-career-opportunities\/\">Let&#8217;s explore the Career Opportunities in Java<\/a><\/strong><\/p>\n<div id=\"attachment_4795\" style=\"width: 739px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/verifying-javac-img7.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4795\" class=\"wp-image-4795 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/verifying-javac-img7.png\" alt=\" Install Java 8 on Ubuntu07\" width=\"729\" height=\"525\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/verifying-javac-img7.png 729w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/verifying-javac-img7-150x108.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/verifying-javac-img7-300x216.png 300w\" sizes=\"auto, (max-width: 729px) 100vw, 729px\" \/><\/a><p id=\"caption-attachment-4795\" class=\"wp-caption-text\">Step.7 Install Java 8 on Ubuntu<\/p><\/div>\n<div id=\"attachment_4796\" style=\"width: 736px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/display-java-version-img8.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4796\" class=\"wp-image-4796 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/display-java-version-img8.png\" alt=\" Install Java 8 on Ubuntu008\" width=\"726\" height=\"530\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/display-java-version-img8.png 726w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/display-java-version-img8-150x110.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/display-java-version-img8-300x219.png 300w\" sizes=\"auto, (max-width: 726px) 100vw, 726px\" \/><\/a><p id=\"caption-attachment-4796\" class=\"wp-caption-text\">Step 8: Install Java 8 on Ubuntu<\/p><\/div>\n<p>Here we will discuss the\u00a0steps to\u00a0install\u00a0Java 8 on Ubuntu-<\/p>\n<p><span style=\"font-weight: 400\"><strong>i)<\/strong> At first, we will download the package file from the official website.\u00a0 <\/span><br \/>\n<a href=\"https:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/jdk8-downloads-2133151.html\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400\"><strong>http:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/jdk8-downloads-2133151.html<\/strong>\u00a0<\/span><\/a><\/p>\n<p><span style=\"font-weight: 400\">The download package is different for 64-bit and 32-bit versions.<\/span><\/p>\n<p><span style=\"font-family: Verdana, Geneva, sans-serif\"><strong>ii)<\/strong> We will need some superuser privileges to install JDK. So we will use the <\/span>following<span style=\"font-family: Verdana, Geneva, sans-serif\"> command-<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">sudo su<\/pre>\n<p><span style=\"font-weight: 400\"><strong>iii)<\/strong> The \/opt directory is actually reserved for all the software and add-on packages. This software is not part of the default installation. The command for creating a directory for JDK installation is-<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">mkdir \/opt\/jdk<\/pre>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/java-frameworks\/\" target=\"_blank\" rel=\"noopener\">Follow this link to know about Java Frameworks<\/a><\/strong><\/p>\n<p><span style=\"font-family: Verdana, Geneva, sans-serif\"><strong>iv)<\/strong> Then we will extract Java into the \/opt\/<\/span>jdk<span style=\"font-family: Verdana, Geneva, sans-serif\"> directory:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">tar -zxf jdk-8u5-linux-x64.tar.gz -C \/opt\/jdk<\/pre>\n<p><span style=\"font-family: Verdana, Geneva, sans-serif\"><strong>v)<\/strong> Then we use the following command. This command verifies the file extraction into the \/opt\/<\/span>jdk<span style=\"font-family: Verdana, Geneva, sans-serif\"> directory.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">ls \/opt\/jdk<\/pre>\n<p><span style=\"font-family: Verdana, Geneva, sans-serif\"><strong>vi)<\/strong> By default, we can find the Java executable in \/opt\/<\/span>jdk<span style=\"font-family: Verdana, Geneva, sans-serif\">\/jdk1.8.0_05\/bin\/java directory. To set it as the default JVM we will use:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">update-alternatives --install \/usr\/bin\/java java \/opt\/jdk\/jdk1.8.0_05\/bin\/java 100\r\nupdate-alternatives --install \/usr\/bin\/javac javac \/opt\/jdk\/jdk1.8.0_05\/bin\/javac 100<\/pre>\n<p><span style=\"font-weight: 400\"><strong>vii)<\/strong> Then verify that Java has been successfully configured. Run the following command-<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">update-alternatives --display java\r\nupdate-alternatives --display javac<\/pre>\n<p><span style=\"font-weight: 400\">We can check the installation by-<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">java -version<\/pre>\n<p><span style=\"font-weight: 400\"><strong>viii)<\/strong> We can also update Java. Hence, download an updated version of Oracle&#8217;s website and extract to the \/opt\/jdk directory. After that, set it as the default JVM with a higher priority number:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">update-alternatives --install \/usr\/bin\/java java \/opt\/jdk\/jdk.new.version\/bin\/java 110\r\nupdate-alternatives --install \/usr\/bin\/javac javac \/opt\/jdk\/jdk.new.version\/bin\/javac 110<\/pre>\n<p>So, this was all about installing Java 8 in Ubuntu. Hope you like our explanation.<\/p>\n<h3>Conclusion<\/h3>\n<p>Hence, we studied the steps to install Java 8 on Ubuntu. Furthermore, if you have any queries, feel free to ask in the comment box. Now, it&#8217;s time to deep dive into the Java language.<\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/java-10-features\/\" target=\"_blank\" rel=\"noopener\">See Also &#8211;\u00a0 Java 10 Features\u00a0<\/a><\/strong><\/p>\n<p><strong><a href=\"https:\/\/en.wikipedia.org\/wiki\/Java_(programming_language)\">Reference\u00a0<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will learn how to install Java 8 on Ubuntu OS. We will install JDK in Ubuntu. Java is a programming language which is actually developed by Sun Microsystems. Java is&#46;&#46;&#46;<\/p>\n","protected":false},"author":7,"featured_media":42873,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[4041,6216,16438,6778,7548],"class_list":["post-4788","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-download-java","tag-how-to-install-java","tag-install-java-8","tag-install-java-on-ubuntu","tag-java-installation"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Install Java 8 on Ubuntu - Step by Step Guide for Beginners - DataFlair<\/title>\n<meta name=\"description\" content=\"This Java tutorial covers the step-by-step process of installing Java 8 on Ubuntu for Beginners. Follow these steps &amp; start coding.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/install-java-8-on-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Install Java 8 on Ubuntu - Step by Step Guide for Beginners - DataFlair\" \/>\n<meta property=\"og:description\" content=\"This Java tutorial covers the step-by-step process of installing Java 8 on Ubuntu for Beginners. Follow these steps &amp; start coding.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/install-java-8-on-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-11-09T00:45:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-05T09:58:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Install-Java-on-Ubuntu-01.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Install Java 8 on Ubuntu - Step by Step Guide for Beginners - DataFlair","description":"This Java tutorial covers the step-by-step process of installing Java 8 on Ubuntu for Beginners. Follow these steps & start coding.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/install-java-8-on-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"Install Java 8 on Ubuntu - Step by Step Guide for Beginners - DataFlair","og_description":"This Java tutorial covers the step-by-step process of installing Java 8 on Ubuntu for Beginners. Follow these steps & start coding.","og_url":"https:\/\/data-flair.training\/blogs\/install-java-8-on-ubuntu\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2017-11-09T00:45:58+00:00","article_modified_time":"2026-05-05T09:58:52+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Install-Java-on-Ubuntu-01.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/install-java-8-on-ubuntu\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/install-java-8-on-ubuntu\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/beb0cab24b7aa54423a3b50e669a9dcd"},"headline":"Install Java 8 on Ubuntu &#8211; Step by Step Guide for Beginners","datePublished":"2017-11-09T00:45:58+00:00","dateModified":"2026-05-05T09:58:52+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/install-java-8-on-ubuntu\/"},"wordCount":495,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/install-java-8-on-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Install-Java-on-Ubuntu-01.jpg","keywords":["Download java","How to install JAVA","Install Java 8","install Java on Ubuntu","Java installation"],"articleSection":["Java Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/install-java-8-on-ubuntu\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/install-java-8-on-ubuntu\/","url":"https:\/\/data-flair.training\/blogs\/install-java-8-on-ubuntu\/","name":"Install Java 8 on Ubuntu - Step by Step Guide for Beginners - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/install-java-8-on-ubuntu\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/install-java-8-on-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Install-Java-on-Ubuntu-01.jpg","datePublished":"2017-11-09T00:45:58+00:00","dateModified":"2026-05-05T09:58:52+00:00","description":"This Java tutorial covers the step-by-step process of installing Java 8 on Ubuntu for Beginners. Follow these steps & start coding.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/install-java-8-on-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/install-java-8-on-ubuntu\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/install-java-8-on-ubuntu\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Install-Java-on-Ubuntu-01.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/11\/Install-Java-on-Ubuntu-01.jpg","width":1200,"height":628,"caption":"Install Java 8 on Ubuntu - Step by Step Guide for Beginners"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/install-java-8-on-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Java Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/java\/"},{"@type":"ListItem","position":3,"name":"Install Java 8 on Ubuntu &#8211; Step by Step Guide for Beginners"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/beb0cab24b7aa54423a3b50e669a9dcd","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team specializes in creating clear, actionable content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Backed by industry expertise, we make learning easy and career-oriented for beginners and pros alike.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam3\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/4788","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=4788"}],"version-history":[{"count":11,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/4788\/revisions"}],"predecessor-version":[{"id":148212,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/4788\/revisions\/148212"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/42873"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=4788"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=4788"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=4788"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}