{"id":16294,"date":"2025-01-14T05:42:15","date_gmt":"2025-01-14T05:42:15","guid":{"rendered":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?p=16294"},"modified":"2025-01-14T05:42:16","modified_gmt":"2025-01-14T05:42:16","slug":"install-java-on-ubuntu","status":"publish","type":"post","link":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/","title":{"rendered":"Install Java On Ubuntu: A Beginner\u2019s Guide"},"content":{"rendered":"\n<p>Java is one of the most popular programming languages used for building different web applications. It possesses a versatile nature and offers different features. Hence, both beginners and experienced developers prefer this website framework. If your website is hosted on Ubuntu VPS, installing Java is a major step to start developing and running Java-based applications.&nbsp;<\/p>\n\n\n\n<p>Whether you need Java for software development or to run Java-based tools, Ubuntu makes the installation process simple. In this knowledge-based article, we will walk you through the steps required to install Java on Ubuntu, ensuring that your system is set up properly for Java development and execution.<\/p>\n\n\n\n<p><strong>Prerequisites<\/strong><\/p>\n\n\n\n<p>Ubuntu 22.04 server set up that includes a sudo non-root user and a firewall.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Installing Java<\/h2>\n\n\n\n<p>The first step is to install Java which is one of two main components JDK and JRE. The JDK provides essential software tools for working in Java, such as a compiler and debugger. Oracle has developed and recognized these versions. OpenJDK has the addition of community contributions due to its open-source nature.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Installing the Default JRE\/JDK<\/h3>\n\n\n\n<p>The first option for installing Java is to use the version packaged with Ubuntu. By default, Ubuntu 22.04 includes Open JDK 11, which is an open-source variant of the JRE and JDK. First, update your apt package index and install the OpenJDK version of Java.&nbsp;&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update<\/code><\/pre>\n\n\n\n<p>Next, check the installation status of Java.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>java \u2013version<\/code><\/pre>\n\n\n\n<p>You will get the following output if Java is not installed.&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Output\n\nCommand 'java' not found, but can be installed with:\n\nsudo apt install default-jre&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # version 2:1.11-72build1, or\n\nsudo apt install openjdk-11-jre-headless&nbsp; # version 11.0.14+9-0ubuntu2\n\nsudo apt install openjdk-17-jre-headless&nbsp; # version 17.0.2+8-1\n\nsudo apt install openjdk-18-jre-headless&nbsp; # version 18~36ea-1\n\nsudo apt install openjdk-8-jre-headless &nbsp; # version 8u312-b07-0ubuntu1<\/code><\/pre>\n\n\n\n<p>If you want to install the JRE from OpenJDK 11, execute the following command.&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install default-jre<\/code><\/pre>\n\n\n\n<p>The JRE will allow you to run almost all Java software.<\/p>\n\n\n\n<p>Verify the installation with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>java \u2013version<\/code><\/pre>\n\n\n\n<p>Get a similar output to the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Output\n\nopenjdk version \"11.0.14\" 2022-01-18\n\nOpenJDK Runtime Environment (build 11.0.14+9-Ubuntu-0ubuntu2)\n\nOpenJDK 64-Bit Server VM (build 11.0.14+9-Ubuntu-0ubuntu2, mixed mode, sharing)<\/code><\/pre>\n\n\n\n<p>Some Java-based software may require the JDK in addition to the JRE. Run the following command to install the JDK, which will also install the JRE:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install default-jdk<\/code><\/pre>\n\n\n\n<p>Verify that the JDK is installed by checking the version of Javac, the Java compiler:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>javac -version<\/code><\/pre>\n\n\n\n<p>You\u2019ll see the following output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Output\n\njavac 11.0.14<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Installing Oracle JDK 11<\/h3>\n\n\n\n<p>Oracle\u2019s official website allows you to create an account on it and manually download the JDK. It is done to add a new package repository for the version you would like to use.&nbsp;<\/p>\n\n\n\n<p>Then you can use apt to install it with help from a third-party installation script. Oracle JDK comes with the JRE included, so you don\u2019t need to install that separately.<\/p>\n\n\n\n<p>The version of Oracle\u2019s JDK you\u2019ll need to download must match the version of the installer script. To find out which version you need, visit the oracle-java11-installer page.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"309\" src=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/oracle-java11-installer-page-1024x309.jpg\" alt=\"oracle-java11-installer page\" class=\"wp-image-16298\" srcset=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/oracle-java11-installer-page-1024x309.jpg 1024w, https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/oracle-java11-installer-page-300x91.jpg 300w, https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/oracle-java11-installer-page-768x232.jpg 768w, https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/oracle-java11-installer-page.jpg 1473w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>In this image, the JavaScript version 11.0.13 script is seen. Hence, you will be requiring Oracle JDK 11.0.13. The version number varies according to the software you are installing. However, no need to download anything from this page. You can do the same through apt shortly. Locate the version you need in the Archive Downloads.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"309\" src=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/javascript-version-script-1024x309.png\" alt=\"JavaScript version 11.0.13 script\" class=\"wp-image-16300\" srcset=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/javascript-version-script-1024x309.png 1024w, https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/javascript-version-script-300x91.png 300w, https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/javascript-version-script-768x232.png 768w, https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/javascript-version-script-1536x464.png 1536w, https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/javascript-version-script.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>From the given below list, you have to choose the Linux x64 compressed archive .tar.gz package:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"621\" src=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/linux-x64-compressed-archive-package-1024x621.png\" alt=\"Linux x64 compressed archive .tar.gz package\" class=\"wp-image-16303\" srcset=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/linux-x64-compressed-archive-package-1024x621.png 1024w, https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/linux-x64-compressed-archive-package-300x182.png 300w, https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/linux-x64-compressed-archive-package-768x466.png 768w, https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/linux-x64-compressed-archive-package-1536x932.png 1536w, https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/linux-x64-compressed-archive-package-2048x1242.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>You&#8217;ll be asked to accept the Oracle license agreement. The license agreement can be accepted by selecting the checkbox and clicking Download.&nbsp;<\/p>\n\n\n\n<p>Once the file has been downloaded, you&#8217;ll need to upload it to your server. Upload the file to your server from your local machine. Using the scp command, transfer the file to the home directory of your Sammy user on macOS, Linux, or Windows using the Windows Subsystem for Linux. If you saved the Oracle JDK file to the Downloads folder on your local machine, run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>scp Downloads\/jdk-11.0.13_linux-x64_bin.tar.gz sammy@your_server_ip:~<\/code><\/pre>\n\n\n\n<p>After uploading the files, return to your server and add the third-party repository to install Oracle&#8217;s Java.<\/p>\n\n\n\n<p>To verify the software you&#8217;re about to install, import the signing key:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo gpg --homedir \/tmp --no-default-keyring --keyring \/usr\/share\/keyrings\/oracle-jdk11-installer.gpg --keyserver keyserver.ubuntu.com --recv-keys EA8CACC073C3DB2A<\/code><\/pre>\n\n\n\n<p>The output is here which you can see on your screen as well:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Output<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>gpg: keybox '\/usr\/share\/keyrings\/oracle-jdk11-installer.gpg' created<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>gpg: \/tmp\/trustdb.gpg: trustdb created<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>gpg: key EA8CACC073C3DB2A: public key \"Launchpad PPA for Linux Uprising\" imported<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>gpg: Total number processed: 1<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>gpg: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; imported: 1<\/code><\/pre>\n\n\n\n<p>Now, add the repository to your package sources list:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"deb &#91;arch=amd64 signed-by=\/usr\/share\/keyrings\/oracle-jdk11-installer.gpg] https:\/\/ppa.launchpadcontent.net\/linuxuprising\/java\/ubuntu jammy main\" | sudo tee \/etc\/apt\/sources.list.d\/oracle-jdk11-installer.list &gt; \/dev\/null<\/code><\/pre>\n\n\n\n<p>Update your package list to make the new software available for installation:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update<\/code><\/pre>\n\n\n\n<p>The installer will look for the Oracle JDK you downloaded in \/var\/cache\/oracle-jdk11-installer-local. Create this directory and move the Oracle JDK archive there:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir -p \/var\/cache\/oracle-jdk11-installer-local\/<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo cp jdk-11.0.13_linux-x64_bin.tar.gz \/var\/cache\/oracle-jdk11-installer-local\/<\/code><\/pre>\n\n\n\n<p>Finally, you are ready to install the package by executing this command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install oracle-java11-installer-local<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Managing Java<\/h2>\n\n\n\n<p>On one server, you can have multiple Java installations. You can configure the version which is the default for use on the command line by leveraging the update alternatives command.&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo update-alternatives --config java<\/code><\/pre>\n\n\n\n<p>Here is an output which would like if you have installed both versions of Java in the tutorial:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Output<\/code><\/pre>\n\n\n\n<p>There are 2 choices for the alternative java (providing \/usr\/bin\/java).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;&nbsp;Selection&nbsp; &nbsp; Path &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Priority &nbsp; Status<\/code><\/pre>\n\n\n\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;&nbsp;0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/usr\/lib\/jvm\/java-11-openjdk-amd64\/bin\/java &nbsp; 1111&nbsp; &nbsp; &nbsp; auto mode\n\n&nbsp;&nbsp;1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/usr\/lib\/jvm\/java-11-openjdk-amd64\/bin\/java &nbsp; 1111&nbsp; &nbsp; &nbsp; manual mode\n\n* 2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/usr\/lib\/jvm\/java-11-oracle\/bin\/java&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1091&nbsp; &nbsp; &nbsp; manual mode<\/code><\/pre>\n\n\n\n<p>Press &lt;enter&gt; to keep the current choice[*], or type selection number:<\/p>\n\n\n\n<p>Decide the number that is associated with the Java version to use as the default, or press ENTER to leave the current settings in place. You can do this for other Java commands, such as the compiler (javac).&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo update-alternatives --config javac<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Setting the JAVA_HOME Environment Variable<\/h2>\n\n\n\n<p>Several programs which are written in Java use the JAVA_HOME environment variable to decide the Java installation locations. Determine where Java is installed if you want to set this environment variable. Use the update-alternatives command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo update-alternatives --config java<\/code><\/pre>\n\n\n\n<p>This command shows each installation of Java along with its installation path:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Output<\/code><\/pre>\n\n\n\n<p>There are 2 choices for the alternative java (providing \/usr\/bin\/java).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;&nbsp;Selection&nbsp; &nbsp; Path &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Priority &nbsp; Status<\/code><\/pre>\n\n\n\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;&nbsp;0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/usr\/lib\/jvm\/java-11-openjdk-amd64\/bin\/java &nbsp; 1111&nbsp; &nbsp; &nbsp; auto mode\n\n &nbsp;1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/usr\/lib\/jvm\/java-11-openjdk-amd64\/bin\/java &nbsp; 1111&nbsp; &nbsp; &nbsp; manual mode\n\n* 2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/usr\/lib\/jvm\/java-11-oracle\/bin\/java&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1091&nbsp; &nbsp; &nbsp; manual mode<\/code><\/pre>\n\n\n\n<p>Press &lt;enter&gt; to keep the current choice[*], or type selection number:<\/p>\n\n\n\n<p>You can follow these installation paths in this case:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>OpenJDK 11 is located at \/usr\/lib\/jvm\/java-11-openjdk-amd64\/bin\/java.\n\nOracle Java is located at \/usr\/lib\/jvm\/java-11-oracle\/jre\/bin\/java.<\/code><\/pre>\n\n\n\n<p>Open \/etc\/environment using nano or your preferred text editor, then copy the path from your chosen installation.<\/p>\n\n\n\n<p>You need to add the following line, at the end of this file. Ensure to replace the highlighted path with your own copied path. Also not include the bin\/portion of the path:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/etc\/environment\n\nJAVA_HOME=\"\/usr\/lib\/jvm\/java-11-openjdk-amd64\"<\/code><\/pre>\n\n\n\n<p>Modifying this file will set the JAVA_HOME path for all users on your system.&nbsp;<\/p>\n\n\n\n<p>Save the file and exit the editor.&nbsp;<\/p>\n\n\n\n<p>Next, reload this file to apply the changes to your current session:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>source \/etc\/environment<\/code><\/pre>\n\n\n\n<p>You need to verify that the variable environment is set or not:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo $JAVA_HOME<\/code><\/pre>\n\n\n\n<p>You\u2019ll see the path you just set:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Output<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/usr\/lib\/jvm\/java-11-openjdk-amd64<\/code><\/pre>\n\n\n\n<p>Other users will need to run the command source \/etc\/environment or log out and log back in to apply this setting.<\/p>\n\n\n\n<div class=\"vlt-box \">\n<div class=\"box-title\" style=\"background:#D5EAFF; color:#000\">Conclusion<\/div>\n<div class=\"box-content\" >\n<p>Installing Java on Ubuntu is a straightforward process that prepares your system for a wide range of programming and development tasks. By following the steps outlined in this guide, you can easily set up the Java Runtime Environment (JRE) or the Java Development Kit (JDK) based on your needs.<\/p>\n<p>With Java successfully installed, you can start building and running Java applications seamlessly. Make sure to keep your Java version updated to enjoy the latest features and security enhancements. If you encounter any issues during installation, the Ubuntu community offers extensive resources and support to help you resolve them quickly.<\/p>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Java is one of the most popular programming languages used for building different web applications. It possesses a versatile nature and offers different features. Hence, both beginners and experienced developers prefer this website framework. If your website is hosted on Ubuntu VPS, installing Java is a major step to start developing and running Java-based applications.&nbsp; [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[],"class_list":["post-16294","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-howtos"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Install Java On Ubuntu: A Beginner\u2019s Guide<\/title>\n<meta name=\"description\" content=\"Learn how to easily install Java (OpenJDK) on your Ubuntu system. This beginner-friendly guide provides step-by-step instructions for both JDK and JRE installations.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Install Java On Ubuntu: A Beginner\u2019s Guide\" \/>\n<meta property=\"og:description\" content=\"Learn how to easily install Java (OpenJDK) on your Ubuntu system. This beginner-friendly guide provides step-by-step instructions for both JDK and JRE installations.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2025-01-14T05:42:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-14T05:42:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/oracle-java11-installer-page.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1473\" \/>\n\t<meta property=\"og:image:height\" content=\"445\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ujwala\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ujwala\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/\",\"name\":\"Install Java On Ubuntu: A Beginner\u2019s Guide\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/oracle-java11-installer-page-1024x309.jpg\",\"datePublished\":\"2025-01-14T05:42:15+00:00\",\"dateModified\":\"2025-01-14T05:42:16+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/485f82549b85b9f4c82dc208c42964a8\"},\"description\":\"Learn how to easily install Java (OpenJDK) on your Ubuntu system. This beginner-friendly guide provides step-by-step instructions for both JDK and JRE installations.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/#primaryimage\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/oracle-java11-installer-page.jpg\",\"contentUrl\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/oracle-java11-installer-page.jpg\",\"width\":1473,\"height\":445,\"caption\":\"oracle-java11-installer page\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Install Java On Ubuntu: A Beginner\u2019s Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/485f82549b85b9f4c82dc208c42964a8\",\"name\":\"Ujwala\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8d26ea4b9b2d83ae90b67f6bf5eefbca?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8d26ea4b9b2d83ae90b67f6bf5eefbca?s=96&d=blank&r=g\",\"caption\":\"Ujwala\"},\"description\":\"My aim is to create enriching content on topics related to SEO, web hosting and social media. The idea is to elevate the readers to new levels of usability, accessibility and understanding.\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/ujwala\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Install Java On Ubuntu: A Beginner\u2019s Guide","description":"Learn how to easily install Java (OpenJDK) on your Ubuntu system. This beginner-friendly guide provides step-by-step instructions for both JDK and JRE installations.","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:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/","og_locale":"en_GB","og_type":"article","og_title":"Install Java On Ubuntu: A Beginner\u2019s Guide","og_description":"Learn how to easily install Java (OpenJDK) on your Ubuntu system. This beginner-friendly guide provides step-by-step instructions for both JDK and JRE installations.","og_url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2025-01-14T05:42:15+00:00","article_modified_time":"2025-01-14T05:42:16+00:00","og_image":[{"width":1473,"height":445,"url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/oracle-java11-installer-page.jpg","type":"image\/jpeg"}],"author":"Ujwala","twitter_misc":{"Written by":"Ujwala","Estimated reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/","name":"Install Java On Ubuntu: A Beginner\u2019s Guide","isPartOf":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/#primaryimage"},"image":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/oracle-java11-installer-page-1024x309.jpg","datePublished":"2025-01-14T05:42:15+00:00","dateModified":"2025-01-14T05:42:16+00:00","author":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/485f82549b85b9f4c82dc208c42964a8"},"description":"Learn how to easily install Java (OpenJDK) on your Ubuntu system. This beginner-friendly guide provides step-by-step instructions for both JDK and JRE installations.","breadcrumb":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/#primaryimage","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/oracle-java11-installer-page.jpg","contentUrl":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2025\/01\/oracle-java11-installer-page.jpg","width":1473,"height":445,"caption":"oracle-java11-installer page"},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/install-java-on-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"Install Java On Ubuntu: A Beginner\u2019s Guide"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/485f82549b85b9f4c82dc208c42964a8","name":"Ujwala","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8d26ea4b9b2d83ae90b67f6bf5eefbca?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8d26ea4b9b2d83ae90b67f6bf5eefbca?s=96&d=blank&r=g","caption":"Ujwala"},"description":"My aim is to create enriching content on topics related to SEO, web hosting and social media. The idea is to elevate the readers to new levels of usability, accessibility and understanding.","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/ujwala\/"}]}},"views":0,"_links":{"self":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/16294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=16294"}],"version-history":[{"count":5,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/16294\/revisions"}],"predecessor-version":[{"id":16305,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/16294\/revisions\/16305"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=16294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=16294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=16294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}