{"id":5042,"date":"2023-02-01T16:44:51","date_gmt":"2023-02-01T16:44:51","guid":{"rendered":"https:\/\/arzhost.com\/blogs\/?p=5042"},"modified":"2025-09-19T15:04:10","modified_gmt":"2025-09-19T10:04:10","slug":"how-to-install-java-on-raspberry-pi","status":"publish","type":"post","link":"https:\/\/arzhost.com\/blogs\/how-to-install-java-on-raspberry-pi\/","title":{"rendered":"How to Install Java on Raspberry Pi?"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/arzhost.com\/blogs\/how-to-install-java-on-raspberry-pi\/#Introduction_Getting_Started_with_Java_on_Raspberry_Pi\" >Introduction: Getting Started with Java on Raspberry Pi<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/arzhost.com\/blogs\/how-to-install-java-on-raspberry-pi\/#Important_Note_About_Raspberry_Pi_Compatibility_with_Java\" >Important Note About Raspberry Pi Compatibility with Java<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/arzhost.com\/blogs\/how-to-install-java-on-raspberry-pi\/#Java_Installation_Guide_for_Raspberry_Pi_Step-by-Step_Instructions\" >Java Installation Guide for Raspberry Pi: Step-by-Step Instructions<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/arzhost.com\/blogs\/how-to-install-java-on-raspberry-pi\/#1_Install_OpenJDK_Java_11_on_Raspberry_Pi_A_Beginners_Guide\" >1: Install OpenJDK Java 11 on Raspberry Pi: A Beginner&#8217;s Guide<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/arzhost.com\/blogs\/how-to-install-java-on-raspberry-pi\/#One_Payment_Lifetime_Hosting%E2%80%94Sign_Up_Now_and_Save_59\" >One Payment, Lifetime Hosting\u2014Sign Up Now and Save 59%!<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/arzhost.com\/blogs\/how-to-install-java-on-raspberry-pi\/#2_How_to_Install_OpenJDK_Java_8_on_Raspberry_Pi\" >2: How to Install OpenJDK Java 8 on Raspberry Pi<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/arzhost.com\/blogs\/how-to-install-java-on-raspberry-pi\/#3_Optional_Set_the_Default_Java_Version_on_Raspberry_Pi\" >3: Optional: Set the Default Java Version on Raspberry Pi<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/arzhost.com\/blogs\/how-to-install-java-on-raspberry-pi\/#4_Optional_Setting_the_JAVA_HOME_Environment_Variable_on_Raspberry_Pi\" >4: Optional: Setting the JAVA_HOME Environment Variable on Raspberry Pi<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/arzhost.com\/blogs\/how-to-install-java-on-raspberry-pi\/#5_How_to_Completely_Remove_Java_from_Raspberry_Pi\" >5: How to Completely Remove Java from Raspberry Pi<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/arzhost.com\/blogs\/how-to-install-java-on-raspberry-pi\/#Your_Ideal_Hosting_Plan_Awaits%E2%80%94Sign_Up_and_Unlock_Exclusive_Savings\" >Your Ideal Hosting Plan Awaits\u2014Sign Up and Unlock Exclusive Savings!<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/arzhost.com\/blogs\/how-to-install-java-on-raspberry-pi\/#Conclusion_Final_Thoughts_on_Java_Setup_for_Raspberry_Pi\" >Conclusion: Final Thoughts on Java Setup for Raspberry Pi<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/arzhost.com\/blogs\/how-to-install-java-on-raspberry-pi\/#FAQs_Frequently_Asked_Questions\" >FAQs (Frequently Asked Questions)<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/arzhost.com\/blogs\/how-to-install-java-on-raspberry-pi\/#What_versions_of_Java_are_compatible_with_Raspberry_Pi\" >What versions of Java are compatible with Raspberry Pi?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/arzhost.com\/blogs\/how-to-install-java-on-raspberry-pi\/#How_do_I_install_OpenJDK_Java_11_on_my_Raspberry_Pi\" >How do I install OpenJDK Java 11 on my Raspberry Pi?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/arzhost.com\/blogs\/how-to-install-java-on-raspberry-pi\/#What_should_I_do_if_I_want_to_set_a_different_default_Java_version_on_my_Raspberry_Pi\" >What should I do if I want to set a different default Java version on my Raspberry Pi?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/arzhost.com\/blogs\/how-to-install-java-on-raspberry-pi\/#How_can_I_set_the_JAVA_HOME_environment_variable_on_Raspberry_Pi\" >How can I set the JAVA_HOME environment variable on Raspberry Pi?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/arzhost.com\/blogs\/how-to-install-java-on-raspberry-pi\/#What_steps_should_I_follow_to_completely_remove_Java_from_my_Raspberry_Pi\" >What steps should I follow to completely remove Java from my Raspberry Pi?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Introduction_Getting_Started_with_Java_on_Raspberry_Pi\"><\/span><strong>Introduction: Getting Started with Java on Raspberry Pi<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Java is a well-known platform for creating and running software applications. <strong>How to Install Java on Raspberry Pi?<\/strong> Java is widely used to power web-based applications.<\/p>\n\n\n\n<p>How to Install Java on Raspberry Pi with the aid of this guide. The article on <a href=\"https:\/\/arzhost.com\/\"><strong>ARZ Host<\/strong><\/a> also explains how to provide the default JAVA HOME path environment variable and set the default Java version.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Two, three, or four Raspberry Pis<\/li>\n\n\n\n<li>An individual with sudo rights<\/li>\n\n\n\n<li>Access to a command line or terminal<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Important_Note_About_Raspberry_Pi_Compatibility_with_Java\"><\/span><strong><strong>Important Note About Raspberry Pi Compatibility with Java<\/strong><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Go to the next section if you are already familiar with Java and <a href=\"https:\/\/www.raspberrypi.com\/\" target=\"_blank\" rel=\"noopener\"><strong>Raspberry Pi<\/strong><\/a>.<\/p>\n\n\n\n<p>There are two primary Java versions:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>A <strong>Java environment<\/strong> that is open-source and covered by the GNU General Public License is called OpenJDK.<\/code><\/li>\n\n\n\n<li><code><strong>Oracle Java<\/strong> is a for-profit service that offers licensing and support choices.<\/code><\/li>\n<\/ul>\n\n\n\n<p><u>You might come across many acronyms while exploring different Java versions:<\/u><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Standard Edition (SE) (usually for Oracle Java)<\/li>\n\n\n\n<li>Java Runtime Environment (JRE) (for running Java applications)<\/li>\n\n\n\n<li>The Java Development Kit (JDK) (for writing and running Java applications)<\/li>\n\n\n\n<li>Lengthy-Term Support (major software versions intended for long-term use)<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Java_Installation_Guide_for_Raspberry_Pi_Step-by-Step_Instructions\"><\/span><strong><strong>Java Installation Guide for Raspberry Pi: Step-by-Step Instructions<\/strong><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Raspbian is the operating system that comes preinstalled on Raspberry Pi. Because Raspbian is based on Debian, installing Java with terminal commands will use the apt package management.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"536\" title=\"java installation guide for raspberry pi\" src=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/java-installation-guide-for-raspberry-pi-1024x536.jpg\" alt=\"java installation guide for raspberry pi\" class=\"wp-image-13399\" srcset=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/java-installation-guide-for-raspberry-pi-1024x536.jpg 1024w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/java-installation-guide-for-raspberry-pi-300x157.jpg 300w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/java-installation-guide-for-raspberry-pi-768x402.jpg 768w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/java-installation-guide-for-raspberry-pi.jpg 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">java installation guide for raspberry pi<\/figcaption><\/figure><\/div>\n\n\n<p>Installing every package from the default Raspbian software repositories is advised. Numerous packages are incompatible due to the ARM-based system architecture of the Raspberry Pi.<\/p>\n\n\n\n<p>For further guidance on server management, including changing your VPS server hostname, check out our article on how to <a href=\"https:\/\/arzhost.com\/blogs\/change-vps-server-hostname\/\" data-type=\"link\" data-id=\"https:\/\/arzhost.com\/blogs\/change-vps-server-hostname\/\"><strong>Change VPS Server Hostname<\/strong><\/a>. It provides step-by-step instructions to help you configure your server settings.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Install_OpenJDK_Java_11_on_Raspberry_Pi_A_Beginners_Guide\"><\/span><strong>1: <strong>Install OpenJDK Java 11 on Raspberry Pi: A Beginner&#8217;s Guide<\/strong><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>OpenJDK is available in the standard Raspbian repositories in a fully updated and functional state.<\/p>\n\n\n\n<div class=\"wp-block-uagb-call-to-action uagb-block-62ca8e6f wp-block-button uag-blocks-common-selector\" style=\"--z-index-desktop:479;;--z-index-tablet:undefined;;--z-index-mobile:undefined;\"><div class=\"uagb-cta__wrap\"><h2 class=\"uagb-cta__title\"><span class=\"ez-toc-section\" id=\"One_Payment_Lifetime_Hosting%E2%80%94Sign_Up_Now_and_Save_59\"><\/span><a href=\"https:\/\/arzhost.com\/lifetime-web-hosting\/\" data-type=\"link\" data-id=\"https:\/\/arzhost.com\/lifetime-web-hosting\/\">One Payment, Lifetime Hosting\u2014Sign Up Now and Save 59%!<\/a><span class=\"ez-toc-section-end\"><\/span><\/h2><p class=\"uagb-cta__desc\">Hosting for Life at a One-Time Price\u2014Exclusive <strong>59% Discount<\/strong> Today!<\/p><\/div><div class=\"uagb-cta__buttons\"><a href=\"https:\/\/arzhost.com\/lifetime-web-hosting\/\" class=\"uagb-cta__button-link-wrapper wp-block-button__link\" target=\"_self\" rel=\"noopener noreferrer\">Read More<\/a><\/div><\/div>\n\n\n\n<p>1: Type the following in a terminal window:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>sudo apt update\n\nsudo apt install default-jdk<\/textarea><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">sudo<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">apt<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">update<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">sudo<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">apt<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">install<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">default-<\/span><span style=\"color: #D8DEE9\">jdk<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>To use the most recent software, use the first command to update your package repositories. Java is installed using the second command.<\/p>\n\n\n\n<p>2: When prompted, enter Y and press Enter to let the procedure finish.<\/p>\n\n\n\n<p>3: By examining the software version, you can confirm the installation:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>version of Java<\/textarea><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">version<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">of<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Java<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>The software version will be shown by the system. It ought to show something like this:<\/p>\n\n\n\n<p>Depending on the most recent Java version that is accessible, your version may change.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_How_to_Install_OpenJDK_Java_8_on_Raspberry_Pi\"><\/span><strong>2: <strong>How to Install OpenJDK Java 8 on Raspberry Pi<\/strong><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>1: In a terminal window, type the following to install OpenJDK 8:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>apt update with sudo\n\ninstall OpenJDK-8-jdk with sudo apt<\/textarea><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">apt<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">update<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">with<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">sudo<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">install<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">OpenJDK<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #B48EAD\">8<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #D8DEE9\">jdk<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">with<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">sudo<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">apt<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>The list of software packages in your repositories is updated by the first command. The next command sets up Java OpenJDK version 8.<\/p>\n\n\n\n<p><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/QVkSSeoW8QI\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n\n\n\n<p>2: Type Y and press Enter to confirm if necessary and let the procedure finish.<\/p>\n\n\n\n<p>3: Use the following to confirm the installation:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>version of Java<\/textarea><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">version<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">of<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Java<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>The software version will be shown by the system. It ought to show something like this:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Optional_Set_the_Default_Java_Version_on_Raspberry_Pi\"><\/span><strong>3: Optional: Set the Default Java Version on Raspberry Pi<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Your default version will most likely be the most recent if you installed both OpenJDK 8 and 11 (OpenJDK 11). The default Java version on your machine can be verified using:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>version of Java<\/textarea><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">version<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">of<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">Java<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><u>1: To change the Java version manually, start by executing the following command:<\/u><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>update-alternatives sudo java configuration<\/textarea><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">update<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #D8DEE9\">alternatives<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">sudo<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">java<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">configuration<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>All installed Java instances on your Raspberry Pi system will be listed in the output.<\/p>\n\n\n\n<p><u>2: There will be a * next to the default version. To make a different version of Java the system default, enter a selection number and press Enter.<\/u><\/p>\n\n\n\n<p>Refer to the example below for more information:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Optional_Setting_the_JAVA_HOME_Environment_Variable_on_Raspberry_Pi\"><\/span><strong>4: Optional: Setting the JAVA_HOME Environment Variable on Raspberry Pi<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>How to Install Java on Raspberry Pi? You can set the JAVA HOME path environment variable after setting the default Java version for your Raspberry Pi.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"536\" title=\"setting the java\" src=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/setting-the-java-1024x536.jpg\" alt=\"setting the java\" class=\"wp-image-13401\" srcset=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/setting-the-java-1024x536.jpg 1024w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/setting-the-java-300x157.jpg 300w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/setting-the-java-768x402.jpg 768w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/setting-the-java.jpg 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">setting the java<\/figcaption><\/figure><\/div>\n\n\n<p>1: Start by determining where your default Java instance is located:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>update-alternatives sudo java configuration<\/textarea><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">update<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #D8DEE9\">alternatives<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">sudo<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">java<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">configuration<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Generally speaking, the default locations on any Raspberry Pi system are:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>\/usr\/lib\/jvm\/java-11-openjdk-armhf\/bin\/java is the OpenJDK 11 path.\n\n\/usr\/lib\/jvm\/java-8-openjdk-armhf\/jre\/bin\/java is the OpenJDK 8 path.<\/textarea><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">usr<\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">lib<\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">jvm<\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">java<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #B48EAD\">11<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #D8DEE9\">openjdk<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #D8DEE9\">armhf<\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">bin<\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">java<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">is<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">the<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">OpenJDK<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">11<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">path<\/span><span style=\"color: #ECEFF4\">.<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">usr<\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">lib<\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">jvm<\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">java<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #B48EAD\">8<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #D8DEE9\">openjdk<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #D8DEE9\">armhf<\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">jre<\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">bin<\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">java<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">is<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">the<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">OpenJDK<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">8<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">path<\/span><span style=\"color: #ECEFF4\">.<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>2: Edit the \/etc\/environment file after that:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>nano \/etc\/environment with sudo<\/textarea><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">nano<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">etc<\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9\">environment<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">with<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">sudo<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>3: Include the following in the document:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>JAVA HOME=&#8221;path of your default version of java&#8221;<\/textarea><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">JAVA<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">HOME<\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">path of your default version of java<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>For OpenJDK 8, as an illustration, you should type:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>JAVA HOME=&#8221;\/usr\/lib\/jvm\/java-8-openjdk-armhf\/jre\/bin\/java&#8221;<\/textarea><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">JAVA<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">HOME<\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">\/usr\/lib\/jvm\/java-8-openjdk-armhf\/jre\/bin\/java<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>4: After saving the document, close the text editor.<\/p>\n\n\n\n<p>5: Reboot your computer now to make the modifications effective:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>sudo restart<\/textarea><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">sudo<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">restart<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>6: Run the upcoming command to confirm the adjustments:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>reflect $JAVA HOME<\/textarea><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">reflect<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">$JAVA<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">HOME<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>The JAVA HOME location specified in the \/etc\/environment file should be returned in the output.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_How_to_Completely_Remove_Java_from_Raspberry_Pi\"><\/span><strong>5: <strong>How to Completely Remove Java from Raspberry Pi<\/strong><\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>How to Install Java on Raspberry Pi? You used the apt package manager to install Java 8 and\/or Java 11 by following this tutorial. Using apt, you may also remove Java from the Raspberry Pi.<\/p>\n\n\n\n<div class=\"wp-block-uagb-call-to-action uagb-block-349afcb9 wp-block-button uag-blocks-common-selector\" style=\"--z-index-desktop:479;;--z-index-tablet:undefined;;--z-index-mobile:undefined;\"><div class=\"uagb-cta__wrap\"><h2 class=\"uagb-cta__title\"><span class=\"ez-toc-section\" id=\"Your_Ideal_Hosting_Plan_Awaits%E2%80%94Sign_Up_and_Unlock_Exclusive_Savings\"><\/span><a href=\"https:\/\/arzhost.com\/web-hosting\/\">Your Ideal Hosting Plan Awaits\u2014Sign Up and Unlock Exclusive Savings!<\/a><span class=\"ez-toc-section-end\"><\/span><\/h2><p class=\"uagb-cta__desc\">Get Ahead with Reliable Hosting at <strong><a href=\"https:\/\/arzhost.com\/\">ARZ Host<\/a><\/strong>\u2014Limited Time 90% Discount!<\/p><\/div><div class=\"uagb-cta__buttons\"><a href=\"https:\/\/arzhost.com\/web-hosting\/\" class=\"uagb-cta__button-link-wrapper wp-block-button__link\" target=\"_self\" rel=\"noopener noreferrer\">Read More<\/a><\/div><\/div>\n\n\n\n<p><u>Run the following command on your Raspberry Pi device to remove Java 8:<\/u><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>sudo apt remove openjdk-8-jdk<\/textarea><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">sudo<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">apt<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">remove<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">openjdk<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #B48EAD\">8<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #D8DEE9\">jdk<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Wait for the procedure to finish and then press Y and Enter to confirm.<\/p>\n\n\n\n<p><u>Run the following command to remove Java 11 on your Raspberry Pi computer:<\/u><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><textarea class=\"code-block-pro-copy-button-textarea\" aria-hidden=\"true\" readonly>uninstall default-jdk with sudo apt<\/textarea><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">uninstall<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">default-<\/span><span style=\"color: #D8DEE9\">jdk<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">with<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">sudo<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">apt<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Wait for the procedure to finish and then press Y and Enter to confirm.<\/p>\n\n\n\n<p>Check out ARZ Host&#8217;s Other Articles for Hosting and Tech Related Resources and Guides. For database management tips, check out our article on how to <a href=\"https:\/\/arzhost.com\/blogs\/how-to-drop-all-tables-in-a-sql-server-database-a-comprehensive-guide\/\" data-type=\"link\" data-id=\"https:\/\/arzhost.com\/blogs\/how-to-drop-all-tables-in-a-sql-server-database-a-comprehensive-guide\/\"><strong>Drop All Tables in SQL Server Database<\/strong><\/a>. It provides essential steps for managing your SQL Server environment effectively.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion_Final_Thoughts_on_Java_Setup_for_Raspberry_Pi\"><\/span><strong>Conclusion: Final Thoughts on Java Setup for Raspberry Pi<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The instructions on How to Install Java on Raspberry Pi Java 8 and Java 11 on a Raspberry Pi were provided in this tutorial. On your Raspberry Pi, OpenJDK 11 or OpenJDK 8 should now be operationally installed.<\/p>\n\n\n\n<p>The post also instructed you on how to define the JAVA HOME path environment variable and specify the default Java version in use. Visit our <a href=\"https:\/\/arzhost.com\/blogs\/\"><strong>Blog<\/strong><\/a> for tips on how to set environment variables in MacOS or Linux for other tutorials that are similar to this one.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"FAQs_Frequently_Asked_Questions\"><\/span><strong>FAQs (Frequently Asked Questions)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_versions_of_Java_are_compatible_with_Raspberry_Pi\"><\/span><strong>What versions of Java are compatible with Raspberry Pi?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Raspberry Pi supports various Java versions, including OpenJDK Java 8 and Java 11, but compatibility may vary based on your specific Raspberry Pi model.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_do_I_install_OpenJDK_Java_11_on_my_Raspberry_Pi\"><\/span><strong>How do I install OpenJDK Java 11 on my Raspberry Pi?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You can install OpenJDK Java 11 by following the step-by-step instructions provided in the installation guide, which includes commands to update your system and install the package.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_should_I_do_if_I_want_to_set_a_different_default_Java_version_on_my_Raspberry_Pi\"><\/span><strong>What should I do if I want to set a different default Java version on my Raspberry Pi?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You can set the default Java version by using the <code>update-alternatives<\/code> command to select the desired Java version for your system.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_can_I_set_the_JAVA_HOME_environment_variable_on_Raspberry_Pi\"><\/span><strong>How can I set the JAVA_HOME environment variable on Raspberry Pi?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To set the JAVA_HOME environment variable, you need to edit the <code>.bashrc<\/code> file and add the line <code>export JAVA_HOME=\/path\/to\/java<\/code> before applying the changes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_steps_should_I_follow_to_completely_remove_Java_from_my_Raspberry_Pi\"><\/span><strong>What steps should I follow to completely remove Java from my Raspberry Pi?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To completely remove Java, you can use the <code>apt-get remove<\/code> command along with the package name of the installed Java version, followed by cleaning up any remaining configuration files.<\/p>\n\n\n\n<p><strong>Read More:<\/strong><\/p>\n\n\n<ul class=\"wp-block-latest-posts__list wp-block-latest-posts\"><li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/arzhost.com\/blogs\/how-to-fix-403-forbidden-error-wordpress\/\">How To Fix 403 Forbidden Error WordPress<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/arzhost.com\/blogs\/how-to-get-the-most-out-of-claude-ai\/\">How To Get The Most Out Of Claude Ai<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/arzhost.com\/blogs\/bad-gateway-error-502-the-ultimate-guide-to-quick-fixes\/\">Bad Gateway Error (502): The Ultimate Guide to Quick Fixes<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/arzhost.com\/blogs\/a-deep-dive-into-todays-best-linux-distros\/\">A Deep Dive Into Today\u2019s Best Linux Distros<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/arzhost.com\/blogs\/domain-investor-terms-powerful-strategy\/\">Domain Investor Terms: Expert Insight on Powerful Strategy<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Introduction: Getting Started with Java on Raspberry Pi Java is a well-known platform for creating and running software applications. How to Install Java on Raspberry Pi? Java is widely used to power web-based applications. How to Install Java on Raspberry Pi with the aid of this guide. The article on ARZ Host also explains how [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6046,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[76],"tags":[],"table_tags":[],"class_list":["post-5042","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/5042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/comments?post=5042"}],"version-history":[{"count":4,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/5042\/revisions"}],"predecessor-version":[{"id":13402,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/5042\/revisions\/13402"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/media\/6046"}],"wp:attachment":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/media?parent=5042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/categories?post=5042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/tags?post=5042"},{"taxonomy":"table_tags","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/table_tags?post=5042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}