{"id":648,"date":"2019-07-06T12:00:45","date_gmt":"2019-07-06T12:00:45","guid":{"rendered":"http:\/\/kabiliravi.com\/?page_id=648"},"modified":"2019-07-21T13:48:23","modified_gmt":"2019-07-21T13:48:23","slug":"install-java-on-arch","status":"publish","type":"page","link":"http:\/\/kabiliravi.com\/index.php\/software\/programming\/my-java-tutorial\/install-java\/linux-unix\/install-java-on-arch\/","title":{"rendered":"Install Java on Arch"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Install OpenJDK 11 using pacman<\/h2>\n\n\n\n<p>Arch linux has a package manager called <strong>pacman<\/strong>. You can find openjdk in pacman repository. However the latest version of openjdk is 11.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"555\" src=\"http:\/\/kabiliravi.com\/wp-content\/uploads\/2019\/07\/pacman-packages-webpage-1024x555.png\" alt=\"\" class=\"wp-image-782\" srcset=\"http:\/\/kabiliravi.com\/wp-content\/uploads\/2019\/07\/pacman-packages-webpage-1024x555.png 1024w, http:\/\/kabiliravi.com\/wp-content\/uploads\/2019\/07\/pacman-packages-webpage-300x163.png 300w, http:\/\/kabiliravi.com\/wp-content\/uploads\/2019\/07\/pacman-packages-webpage-768x417.png 768w, http:\/\/kabiliravi.com\/wp-content\/uploads\/2019\/07\/pacman-packages-webpage-210x114.png 210w, http:\/\/kabiliravi.com\/wp-content\/uploads\/2019\/07\/pacman-packages-webpage-1536x833.png 1536w, http:\/\/kabiliravi.com\/wp-content\/uploads\/2019\/07\/pacman-packages-webpage-1960x1063.png 1960w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p> You can install openjdk 11 using following command<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo pacman -S jdk11-openjdk<\/pre>\n\n\n\n<p>You will see following logs that show you the openjdk dependencies. It also prompts to proceed or now. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">resolving dependencies\u2026\nlooking for conflicting packages\u2026\nwarning: dependency cycle detected:\nwarning: harfbuzz will be installed before its freetype2 dependency\nPackages (17) freetype2-2.10.1-1  giflib-5.1.9-3  graphite-1:1.3.13-1  harfbuzz-2.5.3-1  hicolor-icon-theme-0.17-1\n               java-environment-common-3-1  java-runtime-common-3-1  jre11-openjdk-11.0.4.u7-1  jre11-openjdk-headless-11.0.4.u7-1\n               lcms2-2.9-1  libjpeg-turbo-2.0.2-1  libnet-1.1.6-3  libpng-1.6.37-1  libtiff-4.0.10-1  nspr-4.21-1  nss-3.44.1-1\n               jdk11-openjdk-11.0.4.u7-1\nTotal Download Size:   113.27 MiB\nTotal Installed Size:  264.64 MiB\n:: Proceed with installation? [Y\/n]<\/pre>\n\n\n\n<p>Type <strong>Y<\/strong> character and enter. This is how the installation logs looked like for me.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">:: Retrieving packages\u2026\n  nspr-4.21-1-x86_64                                          189.2 KiB   281K\/s 00:01 [#################################################] 100%\n  nss-3.44.1-1-x86_64                                        1364.1 KiB   398K\/s 00:03 [#################################################] 100%\n  java-runtime-common-3-1-any                                   4.7 KiB  0.00B\/s 00:00 [#################################################] 100%\n  libjpeg-turbo-2.0.2-1-x86_64                                422.5 KiB  1806K\/s 00:00 [#################################################] 100%\n  libtiff-4.0.10-1-x86_64                                     807.9 KiB   878K\/s 00:01 [#################################################] 100%\n  lcms2-2.9-1-x86_64                                          186.6 KiB  26.0M\/s 00:00 [#################################################] 100%\n  libnet-1.1.6-3-x86_64                                        91.8 KiB  14.9M\/s 00:00 [#################################################] 100%\n  libpng-1.6.37-1-x86_64                                      237.5 KiB  23.2M\/s 00:00 [#################################################] 100%\n  graphite-1:1.3.13-1-x86_64                                  222.4 KiB  31.0M\/s 00:00 [#################################################] 100%\n  harfbuzz-2.5.3-1-x86_64                                     729.9 KiB  1423K\/s 00:01 [#################################################] 100%\n  freetype2-2.10.1-1-x86_64                                   459.8 KiB  1625K\/s 00:00 [#################################################] 100%\n  jre11-openjdk-headless-11.0.4.u7-1-x86_64                    31.9 MiB  1756K\/s 00:19 [#################################################] 100%\n  giflib-5.1.9-3-x86_64                                        78.1 KiB  25.4M\/s 00:00 [#################################################] 100%\n  jre11-openjdk-11.0.4.u7-1-x86_64                            176.0 KiB  17.2M\/s 00:00 [#################################################] 100%\n  java-environment-common-3-1-any                               2.4 KiB  0.00B\/s 00:00 [#################################################] 100%\n  hicolor-icon-theme-0.17-1-any                                10.7 KiB  0.00B\/s 00:00 [#################################################] 100%\n  jdk11-openjdk-11.0.4.u7-1-x86_64                             76.5 MiB  1547K\/s 00:51 [#################################################] 100%\n (17\/17) checking keys in keyring                                                      [#################################################] 100%\n (17\/17) checking package integrity                                                    [#################################################] 100%\n (17\/17) loading package files                                                         [#################################################] 100%\n (17\/17) checking for file conflicts                                                   [#################################################] 100%\n (17\/17) checking available disk space                                                 [#################################################] 100%\n :: Processing package changes\u2026\n ( 1\/17) installing java-runtime-common                                                [#################################################] 100%\n For the complete set of Java binaries to be available in your PATH,\n you need to re-login or source \/etc\/profile.d\/jre.sh\n Please note that this package does not support forcing JAVA_HOME as former package java-common did\n ( 2\/17) installing nspr                                                               [#################################################] 100%\n ( 3\/17) installing nss                                                                [#################################################] 100%\n ( 4\/17) installing libjpeg-turbo                                                      [#################################################] 100%\n ( 5\/17) installing libtiff                                                            [#################################################] 100%\n Optional dependencies for libtiff\n     freeglut: for using tiffgt\n ( 6\/17) installing lcms2                                                              [#################################################] 100%\n ( 7\/17) installing libnet                                                             [#################################################] 100%\n ( 8\/17) installing libpng                                                             [#################################################] 100%\n ( 9\/17) installing graphite                                                           [#################################################] 100%\n (10\/17) installing harfbuzz                                                           [#################################################] 100%\n Optional dependencies for harfbuzz\n     cairo: hb-view program\n (11\/17) installing freetype2                                                          [#################################################] 100%\n (12\/17) installing jre11-openjdk-headless                                             [#################################################] 100%\n Optional dependencies for jre11-openjdk-headless\n     java-rhino: for some JavaScript support\n (13\/17) installing giflib                                                             [#################################################] 100%\n (14\/17) installing jre11-openjdk                                                      [#################################################] 100%\n when you use a non-reparenting window manager,\n set _JAVA_AWT_WM_NONREPARENTING=1 in \/etc\/profile.d\/jre.sh\n Optional dependencies for jre11-openjdk\n     alsa-lib: for basic sound support\n     gtk2: for the Gtk+ 2 look and feel - desktop usage\n     gtk3: for the Gtk+ 3 look and feel - desktop usage\n (15\/17) installing java-environment-common                                            [#################################################] 100%\n (16\/17) installing hicolor-icon-theme                                                 [#################################################] 100%\n (17\/17) installing jdk11-openjdk                                                      [#################################################] 100%\n :: Running post-transaction hooks\u2026\n (1\/1) Arming ConditionNeedsUpdate\u2026<\/pre>\n\n\n\n<p>Use <strong>java -version<\/strong> to verify openjdk installation<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">java -version\nopenjdk version \"11.0.4\" 2019-07-16\nOpenJDK Runtime Environment (build 11.0.4+7)\nOpenJDK 64-Bit Server VM (build 11.0.4+7, mixed mode)<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Install openjdk 12 manually<\/h2>\n\n\n\n<p>The first step is downloading the <strong>openjdk<\/strong> binary archive file. The official openjdk website is <a href=\"https:\/\/jdk.java.net\/archive\/\">https:\/\/jdk.java.net<\/a> and you can download the openjdk version you are looking for from <a href=\"https:\/\/jdk.java.net\/archive\/\">https:\/\/jdk.java.net\/archive\/<\/a>.<\/p>\n\n\n\n<p>To download openjdk 12 binary archive file in arch you can use following command. Download it in a place you are going to extract it. For manual installation of an application in linux, linux admins use mostly \/opt folder. However you root access for any write access. That means you need run linux command as sudo user.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Make sure you have wget cli tool installed, if not you can use <strong>sudo pacman -S wget<\/strong> to install it<\/p><\/blockquote>\n\n\n\n<pre class=\"wp-block-preformatted\">$ cd \/opt\n$ sudo mkdir java\n$ cd java\n$ sudo wget https:\/\/download.java.net\/java\/GA\/jdk12\/33\/GPL\/openjdk-12_linux-x64_bin.tar.gz<\/pre>\n\n\n\n<p>After downloading the .tar.gz archive file, you can use <strong>tar -xfv<\/strong> to extract it in \/opt<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo tar -xvf openjdk-12_linux-x64_bin.tar.gz<\/pre>\n\n\n\n<p>After extracting I recommend use <a href=\"http:\/\/kabiliravi.com\/index.php\/software\/programming\/my-java-tutorial\/install-java\/switching-jdks-using-jenv\/\">jEnv<\/a> to set JAVA_HOME and PATH variables. Refer to <a href=\"http:\/\/kabiliravi.com\/index.php\/software\/programming\/my-java-tutorial\/install-java\/switching-jdks-using-jenv\/\">Switching JDKs using jEnv<\/a> for more information<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Install OpenJDK 11 using pacman Arch linux has a package manager called pacman. You can find openjdk in pacman repository. However the latest version of openjdk is 11. You can install openjdk 11 using following command $ sudo pacman -S jdk11-openjdk You will see following logs that show you the openjdk dependencies. It also prompts [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":634,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"ngg_post_thumbnail":0,"footnotes":""},"class_list":["post-648","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/pages\/648","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/comments?post=648"}],"version-history":[{"count":8,"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/pages\/648\/revisions"}],"predecessor-version":[{"id":787,"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/pages\/648\/revisions\/787"}],"up":[{"embeddable":true,"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/pages\/634"}],"wp:attachment":[{"href":"http:\/\/kabiliravi.com\/index.php\/wp-json\/wp\/v2\/media?parent=648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}