{"id":25981,"date":"2024-02-29T15:32:00","date_gmt":"2024-02-29T15:32:00","guid":{"rendered":"https:\/\/linuxways.net\/?p=25981"},"modified":"2024-02-29T15:32:00","modified_gmt":"2024-02-29T15:32:00","slug":"install-java-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/install-java-ubuntu-22-04\/","title":{"rendered":"How to Install Java on Ubuntu 22.04"},"content":{"rendered":"<p><strong>Java<\/strong> is a software development platform and a programming language as well. With more than three decades of existence, <strong>Java<\/strong> is still more popular and preferred over other programming languages. Some people confuse <strong>Java<\/strong> with <strong>JavaScript (JS)<\/strong>, but there is a clear difference i.e., Java code needs compilation, while JS code does not need compilation. <strong>Java<\/strong> is an essential component to be installed on Ubuntu to run the <strong>Java<\/strong> programs smoothly.<\/p>\n<p><strong>Outline<\/strong>:<\/p>\n<ul>\n<li><a href=\"#post-25981-_b91pmxgnsu5m\">How to Install Java on Ubuntu 22.04<\/a><\/li>\n<li><a href=\"#post-25981-_9d19kvyuvfli\">Bonus Tip 1: How to Install the Specific Java Version on Ubuntu 22.04 Using apt Package Manager<\/a><\/li>\n<li><a href=\"#post-25981-_79wvi4ezs6jd\">Bonus Tip 2: How to Install Open JRE 11 on Ubuntu 22.04 Using apt Package Manager<\/a><\/li>\n<li><a href=\"#post-25981-_4l2vrsfzga3y\">Conclusion<\/a><\/li>\n<\/ul>\n<h2><a id=\"post-25981-_b91pmxgnsu5m\"><\/a>How to Install Java on Ubuntu 22.04<\/h2>\n<p>The Java can be installed on Ubuntu using:<\/p>\n<ul>\n<li><a href=\"#post-25981-_en8kg5o5ot53\">apt Package Manager<\/a><\/li>\n<li><a href=\"#post-25981-_c2xxw48mlul7\">Deb Package<\/a><\/li>\n<li><a href=\"#post-25981-_pel085odru23\">GUI<\/a><\/li>\n<\/ul>\n<h3><a id=\"post-25981-_en8kg5o5ot53\"><\/a>Method 1: Install Java on Ubuntu 22.04 Using apt Package Manager<\/h3>\n<p>Ubuntu users can install <strong>Java<\/strong> through the official apt package manager, which is a straightforward, safe, and secure option for quickly installing <strong>Java <\/strong>on the system.<\/p>\n<p>To install <strong>Java <\/strong>on Ubuntu 22.04 using the apt command-line utility, check the guided steps given below.<\/p>\n<p><strong>Step 1: Check the Existence of Java on Ubuntu<\/strong><\/p>\n<p>Before installing <strong>Java <\/strong>on Ubuntu, let&#8217;s check if it is already installed on the system or not by using the given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">java<\/span> <span class=\"re5\">--version<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"816\" height=\"291\" class=\"wp-image-26003\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-1.png 816w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-1-300x107.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-1-768x274.png 768w\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" \/><\/p>\n<p>The output confirms that <strong>Java<\/strong> is not installed on Ubuntu.<\/p>\n<p><strong>Step 2: Install Java on Ubuntu (JDK &amp; JRE)<\/strong><\/p>\n<p>Execute the mentioned command to install <strong>Java<\/strong> on Ubuntu 22.04:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> default-jdk <span class=\"re5\">-y<\/span><\/div><\/div>\n<p>The above command will install the default <strong>Java<\/strong> version stored in the official apt repository. It will install both JDK and JRE, so you do not need to install the JRE separately:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"814\" height=\"246\" class=\"wp-image-26013\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-2.png 814w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-2-300x91.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-2-768x232.png 768w\" sizes=\"auto, (max-width: 814px) 100vw, 814px\" \/><\/p>\n<p><strong>Step 3: Verify the Java Installation<\/strong><\/p>\n<p>Once <strong>Java <\/strong>is installed, execute the below command to check whether it is installed or not:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">java<\/span> <span class=\"re5\">--version<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"814\" height=\"180\" class=\"wp-image-26021\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-3.png 814w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-3-300x66.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-3-768x170.png 768w\" sizes=\"auto, (max-width: 814px) 100vw, 814px\" \/><\/p>\n<h3><a id=\"post-25981-_hpmkluoicf85\"><\/a>How to Remove Java from Ubuntu 22.04 Using apt Package Manager<\/h3>\n<p>If you want to uninstall <strong>Java <\/strong>from Ubuntu 22.04, then execute the mentioned command in Terminal:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt remove default-jdk <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"816\" height=\"243\" class=\"wp-image-26030\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-4.png 816w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-4-300x89.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-4-768x229.png 768w\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" \/><\/p>\n<p><strong>Note:<\/strong> Sometimes removing <strong>Java<\/strong> using the above command does not remove it. In that case, execute the given command to remove all the <strong>Java <\/strong>versions installed on the system:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt autoremove <span class=\"kw2\">java<\/span><span class=\"sy0\">*<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"813\" height=\"179\" class=\"wp-image-26040\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-5.png 813w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-5-300x66.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-5-768x169.png 768w\" sizes=\"auto, (max-width: 813px) 100vw, 813px\" \/><\/p>\n<h3><a id=\"post-25981-_c2xxw48mlul7\"><\/a>Method 2: Install Java on Ubuntu 22.04 Using the Deb Package<\/h3>\n<p>Another method you can use to install <strong>Java <\/strong>on Ubuntu is through the deb package. You can find <strong>Java<\/strong>\u2019s deb package from Oracle\u2019s official website. Installing <strong>Java<\/strong> through the deb package is simple and easy. Check the instructional guide below in the form of steps.<\/p>\n<p><strong>Step 1: Download the Java Deb File Using wget Command<\/strong><\/p>\n<p>To download the deb file of <strong>Java<\/strong>, first, visit the official <a href=\"https:\/\/www.oracle.com\/java\/technologies\/javase\/jdk21-archive-downloads.html\">Oracle website<\/a>, find the Linux x64 Debian Package, right-click on its download link, and copy it:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1097\" height=\"459\" class=\"wp-image-26053\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-6.png 1097w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-6-300x126.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-6-1024x428.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-6-768x321.png 768w\" sizes=\"auto, (max-width: 1097px) 100vw, 1097px\" \/><\/p>\n<p>Once the link is copied, provide it to the <strong>wget<\/strong> command to download the Java deb file:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">wget<\/span> https:<span class=\"sy0\">\/\/<\/span>download.oracle.com<span class=\"sy0\">\/<\/span>java<span class=\"sy0\">\/<\/span><span class=\"nu0\">21<\/span><span class=\"sy0\">\/<\/span>archive<span class=\"sy0\">\/<\/span>jdk-21.0.2_linux-x64_bin.deb<\/div><\/div>\n<p>This will save the deb file in the Home directory:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1191\" height=\"388\" class=\"wp-image-26070\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-7.png 1191w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-7-300x98.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-7-1024x334.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-7-768x250.png 768w\" sizes=\"auto, (max-width: 1191px) 100vw, 1191px\" \/><\/p>\n<p><strong>Step 2: Install Java on Ubuntu<\/strong><\/p>\n<p>After downloading the file, execute the given command to install <strong>Java<\/strong> on Ubuntu 22.04:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> .<span class=\"sy0\">\/<\/span>jdk-21.0.2_linux-x64_bin.deb<\/div><\/div>\n<p>Replace the file name with the file name you downloaded:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"866\" height=\"244\" class=\"wp-image-26078\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-8.png 866w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-8-300x85.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-8-768x216.png 768w\" sizes=\"auto, (max-width: 866px) 100vw, 866px\" \/><\/p>\n<p><strong>Step 3: Verify Java Installation<\/strong><\/p>\n<p>Once the <strong>Java<\/strong> is installed on Ubuntu, use the given command to check whether the <strong>Java<\/strong> is installed or not:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">java<\/span> <span class=\"re5\">--version<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"832\" height=\"160\" class=\"wp-image-26090\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-9.png 832w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-9-300x58.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-9-768x148.png 768w\" sizes=\"auto, (max-width: 832px) 100vw, 832px\" \/><\/p>\n<h3><a id=\"post-25981-_p3x1i3hqkw6e\"><\/a>How to Remove the Specific Version of Java from Ubuntu 22.04 Through apt Package Manager<\/h3>\n<p>Execute the mentioned command below to remove the specific version of <strong>Java <\/strong>from Ubuntu 22.04:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt remove jdk-<span class=\"nu0\">21<\/span> <span class=\"re5\">-y<\/span><\/div><\/div>\n<p>Replace the java version 21 with your desired version to remove it from Ubuntu:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"868\" height=\"285\" class=\"wp-image-26099\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-10.png 868w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-10-300x99.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-10-768x252.png 768w\" sizes=\"auto, (max-width: 868px) 100vw, 868px\" \/><\/p>\n<h3><a id=\"post-25981-_pel085odru23\"><\/a>Method 3: Install Java on Ubuntu 22.04 Using GUI (Graphical User Interface)<\/h3>\n<p>Ubuntu users can install <strong>Java<\/strong> on Ubuntu 22.04 through the Ubuntu Software application. To install <strong>Java <\/strong>on Ubuntu using GUI, check the stepwise guide mentioned below.<\/p>\n<p><strong>Step 1: Download the Java Deb File<\/strong><\/p>\n<p>First, download the deb file of <strong>Java<\/strong> on Ubuntu. To do so, visit the <a href=\"https:\/\/www.oracle.com\/java\/technologies\/javase\/jdk21-archive-downloads.html\">official Oracle website<\/a>, locate the <strong>Linux x64 Debian Package<\/strong>, and click on the highlighted link to start downloading the Java deb package:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1097\" height=\"459\" class=\"wp-image-26103\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-11.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-11.png 1097w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-11-300x126.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-11-1024x428.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-11-768x321.png 768w\" sizes=\"auto, (max-width: 1097px) 100vw, 1097px\" \/><\/p>\n<p>Once the download is complete, check the <strong>Downloads<\/strong> folder to verify whether the file is downloaded or not:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"767\" height=\"434\" class=\"wp-image-26105\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-12.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-12.png 767w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-12-300x170.png 300w\" sizes=\"auto, (max-width: 767px) 100vw, 767px\" \/><\/p>\n<p><strong>Step 2: Install Java Deb Package<\/strong><\/p>\n<p>In the <strong>Downloads<\/strong> folder, right-click on the <strong>Java <\/strong>Deb package, and choose <strong>Open with Other Application<\/strong> option. Then, select <strong>Software Install<\/strong>, and click on the <strong>Select<\/strong> button to install Java via the <strong>Ubuntu Software<\/strong> store:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"769\" height=\"431\" class=\"wp-image-26106\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-13.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-13.png 769w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-13-300x168.png 300w\" sizes=\"auto, (max-width: 769px) 100vw, 769px\" \/><\/p>\n<p>Click on the <strong>Install<\/strong> button to begin the <strong>Java<\/strong> installation on Ubuntu 22.04:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"839\" height=\"329\" class=\"wp-image-26107\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-14.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-14.png 839w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-14-300x118.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-14-768x301.png 768w\" sizes=\"auto, (max-width: 839px) 100vw, 839px\" \/><\/p>\n<h3><a id=\"post-25981-_c1jmvu2jugs9\"><\/a>How to Remove Java from Ubuntu 22.04 Using GUI (Graphical User Interface)<\/h3>\n<p>When you have installed <strong>Java<\/strong> through GUI, then you can remove it using the <strong>Ubuntu Software<\/strong> application. Check the instructional guide provided below to remove <strong>Java<\/strong> from Ubuntu 22.04:<\/p>\n<ul>\n<li>Launch the <strong>Ubuntu Software application<\/strong> available on the left-side panel.<\/li>\n<li>In the Ubuntu Software application, move to the Installed section.<\/li>\n<li>Locate the installed Java package and click <strong>Uninstall <\/strong>to remove it from Ubuntu:<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"824\" height=\"641\" class=\"wp-image-26110\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-15.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-15.png 824w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-15-300x233.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-15-768x597.png 768w\" sizes=\"auto, (max-width: 824px) 100vw, 824px\" \/><\/p>\n<p><strong>Note:<\/strong> Only <strong>Java<\/strong> installed using GUI can be removed through the Ubuntu Software application.<\/p>\n<h2><a id=\"post-25981-_9d19kvyuvfli\"><\/a>Bonus Tip 1: How to Install the Specific Java Version on Ubuntu 22.04 Using apt Package Manager<\/h2>\n<p>Besides installing the default <strong>Java <\/strong>version on Ubuntu, you can also install the version of your choice. The latest<strong> Java <\/strong>version is 21. So, let&#8217;s install the <strong>Java 21<\/strong> version on Ubuntu. To install the specific <strong>Java <\/strong>version 21 on Ubuntu, execute the given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> openjdk-<span class=\"nu0\">21<\/span>-jdk <span class=\"re5\">-y<\/span><\/div><\/div>\n<p>To install the version of your choice, replace 21 with your version:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"964\" height=\"205\" class=\"wp-image-26111\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-16.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-16.png 964w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-16-300x64.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-16-768x163.png 768w\" sizes=\"auto, (max-width: 964px) 100vw, 964px\" \/><\/p>\n<p>Now, let&#8217;s verify whether the <strong>Java<\/strong> version of your choice was installed or not by executing this command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">java<\/span> <span class=\"re5\">--version<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"962\" height=\"178\" class=\"wp-image-26112\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-17.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-17.png 962w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-17-300x56.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-17-768x142.png 768w\" sizes=\"auto, (max-width: 962px) 100vw, 962px\" \/><\/p>\n<p><strong>Note: <\/strong>You may not find all <strong>Java <\/strong>versions in the apt repository.<\/p>\n<h2><a id=\"post-25981-_79wvi4ezs6jd\"><\/a>Bonus Tip 2: How to Install Open JRE 11 on Ubuntu 22.04 Using apt Package Manager<\/h2>\n<p>By default, whenever Java gets installed on the system it also installs the <strong>JRE (Java Runtime Environment)<\/strong> alongside JDK (Java Development Kit). However, in the case you removed the JRE, or it is not functioning well then you can reinstall it by checking the steps provided below.<\/p>\n<p><strong>Step 1: Update apt Repository Packages<\/strong><\/p>\n<p>Make sure to update the system repositories by running the mentioned command in Terminal:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt update<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"962\" height=\"282\" class=\"wp-image-26114\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-18.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-18.png 962w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-18-300x88.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-18-768x225.png 768w\" sizes=\"auto, (max-width: 962px) 100vw, 962px\" \/><\/p>\n<p><strong>Step 2: Install JRE on Ubuntu<\/strong><\/p>\n<p>Execute the below command to install the default JRE version on Ubuntu 22.04:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> default-jre <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"961\" height=\"202\" class=\"wp-image-26117\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-19.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-19.png 961w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-19-300x63.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25981-19-768x161.png 768w\" sizes=\"auto, (max-width: 961px) 100vw, 961px\" \/><\/p>\n<h2><a id=\"post-25981-_4l2vrsfzga3y\"><\/a>Conclusion<\/h2>\n<p><strong>Java<\/strong> is a programming language used to develop mobile applications, desktop applications, and web-based applications. Moreover, <strong>Java<\/strong> itself is a development application used by developers. <strong>Java <\/strong>can be installed on Ubuntu 22.04 using the apt package manager and through a deb file. Additionally, <strong>Java<\/strong> can also be installed using GUI (Ubuntu Software application). You can use any of the provided methods to install <strong>Java<\/strong> on Ubuntu 22.04 according to your preferences from this guide and start running <strong>Java-based<\/strong> applications on your system.<\/p>","protected":false},"excerpt":{"rendered":"<p>Java can be installed on Ubuntu 22.04 using the apt package manager and through a deb file. Additionally, Java can also be installed using Ubuntu Software. <\/p>","protected":false},"author":110,"featured_media":26133,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-25981","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/25981","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/110"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=25981"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/25981\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/26133"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=25981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=25981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=25981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}