{"id":14794,"date":"2025-07-14T10:23:15","date_gmt":"2025-07-14T10:23:15","guid":{"rendered":"https:\/\/greenwebpage.com\/community\/?p=14794"},"modified":"2025-07-14T11:55:36","modified_gmt":"2025-07-14T11:55:36","slug":"how-to-install-openjdk-on-debian-12","status":"publish","type":"post","link":"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/","title":{"rendered":"How to Install OpenJDK on Debian 12"},"content":{"rendered":"\n<p>Having OpenJDK installed on Debian 12 is a prerequisite for developing and running Java applications on your machine. It includes the Java Runtime Environment (JRE) and the Java Development Kit (JDK), which help in executing Java programs, compiling Java code, and building robust applications.<\/p>\n\n\n\n<p>OpenJDK is critical and serves as a prerequisite for Spring-based development environments, Java-based tools like Jenkins, and server applications like Tomcat. OpenJDK is aligned with Java standards, ensuring any applications developed using OpenJDK are portable and work seamlessly across servers, providing a good replacement for Oracle Java.<\/p>\n\n\n\n<p><strong>Table of Contents<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#How-to-Install-OpenJDK-on-Debian-12\">How to install OpenJDK on Debian 12<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#Method-1:-Using-Apt\">Method 1: Using Apt<\/a><\/li>\n\n\n\n<li><a href=\"#Method-2:-Using-Deb\">Method 2: Using Deb<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#Switching-Default-OpenJDK-Version-on-Debian-12\">Switching Default OpenJDK Version on Debian 12<\/a><\/li>\n\n\n\n<li><a href=\"#Configuring-the-Environment-Variable-on-Debian-12\">Setting Environment Variable on Debian 12<\/a><\/li>\n\n\n\n<li><a href=\"#How-to-Uninstall-OpenJDK-from-Debian-12\">How to Uninstall OpenJDK from Debian 12<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#Method-1:-Using-Apt-remove\">Method 1: Using Apt<\/a><\/li>\n\n\n\n<li><a href=\"#Method-2:-Using-Deb-remove\">Method 2: Using Deb<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#Final-Thoughts\">Final Thoughts<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"How-to-Install-OpenJDK-on-Debian-12\"><a id=\"post-14794-_eggwt4bls4js\"><\/a>How to Install OpenJDK on Debian 12<\/h2>\n\n\n\n<p>Users receive an opportunity to download and install one of the most powerful programming tools. OpenJDK is a complete cross-platform on which applications can be developed and executed. It is very useful for downloading due to the constant maintenance and optimizations done on it.<\/p>\n\n\n\n<p>Installing the Java OpenJDK requires the use of the \u2018apt\u2019 package manager and the \u2018deb\u2019 package. Let\u2019s start openjdk-install through the \u2018apt\u2019 method.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"Method-1:-Using-Apt\"><a id=\"post-14794-_oqy4qqz8200\"><\/a>Method 1: Using Apt<\/h3>\n\n\n\n<p>Even though JDK and JRE serve the same purpose of running Java programs, I recommend installing JDK on Debian because it also contains additional tooling for building Java software, which is very useful.<\/p>\n\n\n\n<p>For the OpenJDK installation procedure using Apt on Debian 12, follow these straightforward steps.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"post-14794-_bipi8snlucve\"><\/a>Step 1: Update System Repositories<\/h4>\n\n\n\n<p>To meet the requirements of the mentioned repositories, the following command needs to be run to update and upgrade the given repository.<\/p>\n\n\n\n<pre>sudo apt update &amp;&amp; sudo apt upgrade<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1138\" height=\"394\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-1.png\" alt=\"sudo apt update &amp;&amp; sudo apt upgrade\" class=\"wp-image-14795\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-1.png 1138w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-1-300x104.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-1-1024x355.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-1-768x266.png 768w\" sizes=\"(max-width: 1138px) 100vw, 1138px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"post-14794-_rt2vff8cjqj7\"><\/a>Step 2: Check Available OpenJDK Versions<\/h4>\n\n\n\n<p>Like other software, OpenJDK is also part of the packages installed on the system. Let\u2019s move on to step one.<\/p>\n\n\n\n<pre>javac --version<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1078\" height=\"132\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-2.png\" alt=\"javac --version\" class=\"wp-image-14796\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-2.png 1078w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-2-300x37.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-2-1024x125.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-2-768x94.png 768w\" sizes=\"(max-width: 1078px) 100vw, 1078px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>The output shows that OpenJDK is not installed on the system.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"post-14794-_pvqqtmg2n7w6\"><\/a>Step 3: Install openjdk Using Apt<\/h4>\n\n\n\n<p>Many packages of Java can be installed, the command below is going to install the default open junit for 12 debian.<\/p>\n\n\n\n<pre>sudo apt install default-jdk -y<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1147\" height=\"569\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-3.png\" alt=\"sudo apt install default-jdk -y\" class=\"wp-image-14797\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-3.png 1147w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-3-300x149.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-3-1024x508.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-3-768x381.png 768w\" sizes=\"(max-width: 1147px) 100vw, 1147px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>To install any other version, you only need to replace default-jdk with your preferred package name.<\/p>\n\n\n\n<pre>sudo apt install java_version<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"post-14794-_dubqw4ku9m6p\"><\/a>Step 4: Verify OpenJDK Installation<\/h4>\n\n\n\n<p>Finally, check the version through the command below.<\/p>\n\n\n\n<pre>java --version<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1126\" height=\"197\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-4.png\" alt=\"java --version\" class=\"wp-image-14798\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-4.png 1126w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-4-300x52.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-4-1024x179.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-4-768x134.png 768w\" sizes=\"(max-width: 1126px) 100vw, 1126px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Output confirms that we have \u201copenjdk 17.0.15\u201d Java installed on Debian 12.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"Method-2:-Using-Deb\"><a id=\"post-14794-_blqcwolb7v21\"><\/a>Method 2: Using Deb<\/h3>\n\n\n\n<p>In this method, use wget to download the .deb package of OpenJDK. After that, install it through the apt:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"post-14794-_ypzi3x7gkhb\"><\/a>Step 1: Download the Deb Package<\/h4>\n\n\n\n<p>First, download the .deb file from the Oracle website:<\/p>\n\n\n\n<pre>sudo wget https:\/\/download.oracle.com\/java\/21\/latest\/jdk-21_linux-x64_bin.deb<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1146\" height=\"441\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-5.png\" alt=\"sudo wget https:\/\/download.oracle.com\/java\/21\/latest\/jdk-21_linux-x64_bin.deb\" class=\"wp-image-14799\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-5.png 1146w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-5-300x115.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-5-1024x394.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-5-768x296.png 768w\" sizes=\"(max-width: 1146px) 100vw, 1146px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"post-14794-_dqwo2ag8muhc\"><\/a>Step 2: Install OpenJDK<\/h4>\n\n\n\n<p>Then, install OpenJDK through the .deb file.<\/p>\n\n\n\n<pre>sudo apt install .\/jdk-21_linux-x64_bin.deb<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1137\" height=\"531\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-6.png\" alt=\"sudo apt install .\/jdk-21_linux-x64_bin.deb\" class=\"wp-image-14800\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-6.png 1137w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-6-300x140.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-6-1024x478.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-6-768x359.png 768w\" sizes=\"(max-width: 1137px) 100vw, 1137px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><a id=\"post-14794-_eoxb69gyo18h\"><\/a>Step 3: Confirm OpenJDK Installation<\/h4>\n\n\n\n<p>Finally, authenticate that OpenJDK is installed on Debian 12.<\/p>\n\n\n\n<pre>java --version<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1140\" height=\"208\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-7.png\" alt=\"java --version\" class=\"wp-image-14801\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-7.png 1140w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-7-300x55.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-7-1024x187.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-7-768x140.png 768w\" sizes=\"(max-width: 1140px) 100vw, 1140px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Switching-Default-OpenJDK-Version-on-Debian-12\"><a id=\"post-14794-_803auuu15b9l\"><\/a>Switching Default OpenJDK Version on Debian 12<\/h2>\n\n\n\n<p>If multiple Java installations exist on a device, they can be switched between using the designated command.<\/p>\n\n\n\n<pre>sudo update-alternatives --config java<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1142\" height=\"388\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-8.png\" alt=\"sudo update-alternatives --config java\" class=\"wp-image-14802\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-8.png 1142w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-8-300x102.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-8-1024x348.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-8-768x261.png 768w\" sizes=\"(max-width: 1142px) 100vw, 1142px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>People can choose to either simply hit &#8220;Enter&#8221; to keep the default OpenJDK version or change it by entering the selection number corresponding to the desired version.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Configuring-the-Environment-Variable-on-Debian-12\"><a id=\"post-14794-_iwdehp43q514\"><\/a>Configuring the Environment Variable on Debian 12<\/h2>\n\n\n\n<p>In case you want to modify the JAVA_HOME variable on Debian, you can do that by changing the \/etc\/environment file with the help of nano. You can launch it with the command below.<\/p>\n\n\n\n<pre>sudo nano \/etc\/environment<\/pre>\n\n\n\n<p>Now, modify the variable with the path to the preferred Java version.<\/p>\n\n\n\n<pre>JAVA_HOME=\"\/usr\/lib\/jvm\/java-21-openjdk-amd64\/bin\/java\"<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1120\" height=\"517\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-9.png\" alt=\"JAVA_HOME=&quot;\/usr\/lib\/jvm\/java-21-openjdk-amd64\/bin\/java&quot;\" class=\"wp-image-14803\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-9.png 1120w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-9-300x138.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-9-1024x473.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-9-768x355.png 768w\" sizes=\"(max-width: 1120px) 100vw, 1120px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Finally, hit &#8220;CTRL+S&#8221; and then \u201cCTRL+X&#8221; to save the changes and exit the interface.<\/p>\n\n\n\n<p>To set the defined variable for the active session, the command below can be used to reload \/etc\/environment and apply the changes.<\/p>\n\n\n\n<pre>source \/etc\/environment<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1123\" height=\"112\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-10.png\" alt=\"source \/etc\/environment\" class=\"wp-image-14804\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-10.png 1123w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-10-300x30.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-10-1024x102.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-10-768x77.png 768w\" sizes=\"(max-width: 1123px) 100vw, 1123px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Finally, check that the variable has been correctly defined.<\/p>\n\n\n\n<pre>echo $JAVA_HOME<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1114\" height=\"136\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-11.png\" alt=\"echo $JAVA_HOME\" class=\"wp-image-14805\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-11.png 1114w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-11-300x37.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-11-1024x125.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-11-768x94.png 768w\" sizes=\"(max-width: 1114px) 100vw, 1114px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"How-to-Uninstall-OpenJDK-from-Debian-12\"><a id=\"post-14794-_1kzzblw4mwqh\"><\/a>How to Uninstall OpenJDK from Debian 12<\/h2>\n\n\n\n<p>If for any reason OpenJDK is no longer needed, it can be removed, though this generally comprises the ability to run many applications and reclaim hard drive space. Regardless, OpenJDK can only be uninstalled in the same way that it is installed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"Method-1:-Using-Apt-remove\"><a id=\"post-14794-_gvqx4sbw3cvq\"><\/a>Method 1: Using Apt<\/h3>\n\n\n\n<p>For those who installed openjdk using Apt, it can be removed from Debian 12:<\/p>\n\n\n\n<pre>sudo apt autoremove java* -y<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"Method-2:-Using-Deb-remove\"><a id=\"post-14794-_gx1z9ld7buho\"><\/a>Method 2: Using Deb<\/h3>\n\n\n\n<p>If OpenJDK is installed on Debian using the deb package, it can be removed by executing:<\/p>\n\n\n\n<pre>sudo apt autoremove jdk-21 -y<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1137\" height=\"404\" src=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-12.png\" alt=\"sudo apt autoremove jdk-21 -y\" class=\"wp-image-14806\" srcset=\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-12.png 1137w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-12-300x107.png 300w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-12-1024x364.png 1024w, https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/word-image-14794-12-768x273.png 768w\" sizes=\"(max-width: 1137px) 100vw, 1137px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>This concludes the addition and removal of OpenJDK on Debian 12.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Final-Thoughts\"><a id=\"post-14794-_ke20k0abp09b\"><\/a>Final Thoughts<\/h2>\n\n\n\n<p>Both &#8220;apt&#8221; and &#8220;deb&#8221; options are available to install OpenJDK on Debian 12. As remarked, all methods facilitate the installation of OpenJDK on Debian 12.<\/p>\n\n\n\n<p>To install OpenJDK on Debian 12, first update the package list using sudo apt update. Then, install OpenJDK with the command sudo apt install openjdk-17-jdk. However, all installation methods have their pros and cons. For instance, after OpenJDK is installed via apt or deb, it\u2019s easy to switch between different versions. This guide covers all possible ways to install OpenJDK on Debian 12.<\/p>\n\n    <div class=\"xs_social_share_widget xs_share_url after_content \t\tmain_content  wslu-style-1 wslu-share-box-shaped wslu-fill-colored wslu-none wslu-share-horizontal wslu-theme-font-no wslu-main_content\">\n\n\t\t\n        <ul>\n\t\t\t        <\/ul>\n    <\/div> \n","protected":false},"excerpt":{"rendered":"<p>Having OpenJDK installed on Debian 12 is a prerequisite for developing and running Java applications on your machine. It includes the Java Runtime Environment (JRE) and the Java Development Kit (JDK), which help in executing Java programs, compiling Java code, and building robust applications. OpenJDK is critical and serves as a prerequisite for Spring-based development [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":14813,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[297,257,889,891,890,888],"class_list":["post-14794","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-debian-12","tag-java","tag-java-applications","tag-jdk","tag-jre","tag-openjdk"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Install OpenJDK on Debian 12 - Greenwebpage Community<\/title>\n<meta name=\"description\" content=\"In this tutorial, you will be able to install JDK (Java Development Kit) on your Debian 12 server. Learn more!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install OpenJDK on Debian 12 - Greenwebpage Community\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, you will be able to install JDK (Java Development Kit) on your Debian 12 server. Learn more!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/\" \/>\n<meta property=\"og:site_name\" content=\"Greenwebpage Community\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-14T10:23:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-14T11:55:36+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-Install-OpenJDK-on-Debian-12.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Karim Buzdar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Karim Buzdar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/\"},\"author\":{\"name\":\"Karim Buzdar\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8\"},\"headline\":\"How to Install OpenJDK on Debian 12\",\"datePublished\":\"2025-07-14T10:23:15+00:00\",\"dateModified\":\"2025-07-14T11:55:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/\"},\"wordCount\":775,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-Install-OpenJDK-on-Debian-12.jpg\",\"keywords\":[\"Debian 12\",\"Java\",\"Java Applications\",\"JDK\",\"JRE\",\"OpenJDK\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/\",\"url\":\"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/\",\"name\":\"How to Install OpenJDK on Debian 12 - Greenwebpage Community\",\"isPartOf\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-Install-OpenJDK-on-Debian-12.jpg\",\"datePublished\":\"2025-07-14T10:23:15+00:00\",\"dateModified\":\"2025-07-14T11:55:36+00:00\",\"description\":\"In this tutorial, you will be able to install JDK (Java Development Kit) on your Debian 12 server. Learn more!\",\"breadcrumb\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/#primaryimage\",\"url\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-Install-OpenJDK-on-Debian-12.jpg\",\"contentUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-Install-OpenJDK-on-Debian-12.jpg\",\"width\":1020,\"height\":600,\"caption\":\"How to Install OpenJDK on Debian 12\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/greenwebpage.com\/community\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install OpenJDK on Debian 12\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#website\",\"url\":\"https:\/\/greenwebpage.com\/community\/\",\"name\":\"Greenwebpage Community\",\"description\":\"Get online in three steps with our wide range of web hosting solutions. Choose from professional business to enterprise options designed to meet your needs.\",\"publisher\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/greenwebpage.com\/community\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#organization\",\"name\":\"Greenwebpage Community\",\"url\":\"https:\/\/greenwebpage.com\/community\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png\",\"contentUrl\":\"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png\",\"width\":512,\"height\":512,\"caption\":\"Greenwebpage Community\"},\"image\":{\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8\",\"name\":\"Karim Buzdar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g\",\"caption\":\"Karim Buzdar\"},\"sameAs\":[\"https:\/\/greenwebpage.com\"],\"url\":\"https:\/\/greenwebpage.com\/community\/author\/karim\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install OpenJDK on Debian 12 - Greenwebpage Community","description":"In this tutorial, you will be able to install JDK (Java Development Kit) on your Debian 12 server. Learn more!","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:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/","og_locale":"en_US","og_type":"article","og_title":"How to Install OpenJDK on Debian 12 - Greenwebpage Community","og_description":"In this tutorial, you will be able to install JDK (Java Development Kit) on your Debian 12 server. Learn more!","og_url":"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/","og_site_name":"Greenwebpage Community","article_published_time":"2025-07-14T10:23:15+00:00","article_modified_time":"2025-07-14T11:55:36+00:00","og_image":[{"width":1020,"height":600,"url":"http:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-Install-OpenJDK-on-Debian-12.jpg","type":"image\/jpeg"}],"author":"Karim Buzdar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Karim Buzdar","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/#article","isPartOf":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/"},"author":{"name":"Karim Buzdar","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8"},"headline":"How to Install OpenJDK on Debian 12","datePublished":"2025-07-14T10:23:15+00:00","dateModified":"2025-07-14T11:55:36+00:00","mainEntityOfPage":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/"},"wordCount":775,"commentCount":0,"publisher":{"@id":"https:\/\/greenwebpage.com\/community\/#organization"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/#primaryimage"},"thumbnailUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-Install-OpenJDK-on-Debian-12.jpg","keywords":["Debian 12","Java","Java Applications","JDK","JRE","OpenJDK"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/","url":"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/","name":"How to Install OpenJDK on Debian 12 - Greenwebpage Community","isPartOf":{"@id":"https:\/\/greenwebpage.com\/community\/#website"},"primaryImageOfPage":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/#primaryimage"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/#primaryimage"},"thumbnailUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-Install-OpenJDK-on-Debian-12.jpg","datePublished":"2025-07-14T10:23:15+00:00","dateModified":"2025-07-14T11:55:36+00:00","description":"In this tutorial, you will be able to install JDK (Java Development Kit) on your Debian 12 server. Learn more!","breadcrumb":{"@id":"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/#primaryimage","url":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-Install-OpenJDK-on-Debian-12.jpg","contentUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2025\/07\/How-to-Install-OpenJDK-on-Debian-12.jpg","width":1020,"height":600,"caption":"How to Install OpenJDK on Debian 12"},{"@type":"BreadcrumbList","@id":"https:\/\/greenwebpage.com\/community\/how-to-install-openjdk-on-debian-12\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/greenwebpage.com\/community\/"},{"@type":"ListItem","position":2,"name":"How to Install OpenJDK on Debian 12"}]},{"@type":"WebSite","@id":"https:\/\/greenwebpage.com\/community\/#website","url":"https:\/\/greenwebpage.com\/community\/","name":"Greenwebpage Community","description":"Get online in three steps with our wide range of web hosting solutions. Choose from professional business to enterprise options designed to meet your needs.","publisher":{"@id":"https:\/\/greenwebpage.com\/community\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/greenwebpage.com\/community\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/greenwebpage.com\/community\/#organization","name":"Greenwebpage Community","url":"https:\/\/greenwebpage.com\/community\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/","url":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png","contentUrl":"https:\/\/greenwebpage.com\/community\/wp-content\/uploads\/2023\/10\/cropped-logomic.png","width":512,"height":512,"caption":"Greenwebpage Community"},"image":{"@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/467c100c1d017bc081473ee0440680c8","name":"Karim Buzdar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/greenwebpage.com\/community\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0628fcbcddd9bc5486245d2cf4a904dbcdeac9ad6c3098f49237094e9d513d0c?s=96&d=mm&r=g","caption":"Karim Buzdar"},"sameAs":["https:\/\/greenwebpage.com"],"url":"https:\/\/greenwebpage.com\/community\/author\/karim\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/14794","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/comments?post=14794"}],"version-history":[{"count":6,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/14794\/revisions"}],"predecessor-version":[{"id":14812,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/posts\/14794\/revisions\/14812"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/media\/14813"}],"wp:attachment":[{"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/media?parent=14794"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/categories?post=14794"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/greenwebpage.com\/community\/wp-json\/wp\/v2\/tags?post=14794"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}