{"id":186,"date":"2020-12-04T17:49:24","date_gmt":"2020-12-04T17:49:24","guid":{"rendered":"http:\/\/bhtinstitute.com\/knowhow\/?p=186"},"modified":"2020-12-04T17:49:57","modified_gmt":"2020-12-04T17:49:57","slug":"iii-how-to-set-java_home-in-windows","status":"publish","type":"post","link":"http:\/\/bhtinstitute.com\/knowhow\/iii-how-to-set-java_home-in-windows\/","title":{"rendered":"III- How to Set JAVA_HOME in Windows"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">First, check if&nbsp;<code>JAVA_HOME<\/code>&nbsp;is already set by start a CMD and issue:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>set JAVA_HOME<\/strong><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If&nbsp;<code>JAVA_HOME<\/code>&nbsp;is not set, you will receive &#8220;Environment variable JAVA_HOME not defined&#8221;. Otherwise, the current setting will be shown.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To set\/change&nbsp;<code>JAVA_HOME<\/code>&nbsp;in Windows:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Launch &#8220;Control Panel&#8221;<\/li><li>&#8220;System&#8221;<\/li><li>&#8220;Advanced system settings&#8221;<\/li><li>Switch to &#8220;Advanced&#8221; tab<\/li><li>&#8220;Environment variables&#8221;<\/li><li>Choose &#8220;System Variables&#8221; (for all users)<\/li><li>To&nbsp;<em>add<\/em>&nbsp;a new environment variable &#8220;<code>JAVA_HOME<\/code>&#8220;:<ol><li>Choose &#8220;New&#8221;<\/li><li>In &#8220;Variable Name&#8221;, enter &#8220;JAVA_HOME&#8221;.<\/li><li>In &#8220;Variable Value&#8221;, click &#8220;Browse Directory&#8230;&#8221; and navigate to the JDK installed directory (e.g., &#8220;<code>C:\\Program Files\\Java\\jdk-13.0.1<\/code>&#8220;).<\/li><li>OK \u21d2 OK \u21d2 OK.<\/li><\/ol><\/li><li>To&nbsp;<em>change<\/em>&nbsp;the existing &#8220;<code>JAVA_HOME<\/code>&#8221; setting:<ol><li>Select &#8220;<code>JAVA_HOME<\/code>&#8221; \u21d2 &#8220;Edit&#8221;<\/li><li>In &#8220;Variable Value&#8221;, click &#8220;Browse Directory&#8230;&#8221; and navigate to the JDK installed directory (e.g., &#8220;<code>C:\\Program Files\\Java\\jdk-13.0.1<\/code>&#8220;).<\/li><li>OK \u21d2 OK \u21d2 OK.<\/li><\/ol><\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">You need to&nbsp;<strong>RE-START<\/strong>&nbsp;CMD for the new setting to take effect!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To verify the new setting, re-start CMD:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>set JAVA_HOME<\/strong>\nJAVA_NAME=C:\\Program Files\\Java\\jdk-13.0.1<\/pre>\n\n\n\n<p class=\"has-text-color has-vivid-red-color wp-block-paragraph\">NB:Replace jdk-13.0.1 by your current version<\/p>\n\n\n\n<figure class=\"wp-block-gallery columns-3 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"213\" height=\"236\" src=\"http:\/\/bhtinstitute.com\/knowhow\/wp-content\/uploads\/2020\/12\/env1.jpg\" alt=\"\" data-id=\"189\" data-full-url=\"http:\/\/bhtinstitute.com\/knowhow\/wp-content\/uploads\/2020\/12\/env1.jpg\" data-link=\"http:\/\/bhtinstitute.com\/knowhow\/?attachment_id=189\" class=\"wp-image-189\" srcset=\"http:\/\/bhtinstitute.com\/knowhow\/wp-content\/uploads\/2020\/12\/env1.jpg 213w, http:\/\/bhtinstitute.com\/knowhow\/wp-content\/uploads\/2020\/12\/env1-54x60.jpg 54w, http:\/\/bhtinstitute.com\/knowhow\/wp-content\/uploads\/2020\/12\/env1-135x150.jpg 135w\" sizes=\"auto, (max-width: 213px) 100vw, 213px\" \/><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"384\" height=\"430\" src=\"http:\/\/bhtinstitute.com\/knowhow\/wp-content\/uploads\/2020\/12\/env2.jpg\" alt=\"\" data-id=\"188\" data-full-url=\"http:\/\/bhtinstitute.com\/knowhow\/wp-content\/uploads\/2020\/12\/env2.jpg\" data-link=\"http:\/\/bhtinstitute.com\/knowhow\/?attachment_id=188\" class=\"wp-image-188\" srcset=\"http:\/\/bhtinstitute.com\/knowhow\/wp-content\/uploads\/2020\/12\/env2.jpg 384w, http:\/\/bhtinstitute.com\/knowhow\/wp-content\/uploads\/2020\/12\/env2-268x300.jpg 268w, http:\/\/bhtinstitute.com\/knowhow\/wp-content\/uploads\/2020\/12\/env2-54x60.jpg 54w, http:\/\/bhtinstitute.com\/knowhow\/wp-content\/uploads\/2020\/12\/env2-134x150.jpg 134w\" sizes=\"auto, (max-width: 384px) 100vw, 384px\" \/><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"389\" height=\"279\" src=\"http:\/\/bhtinstitute.com\/knowhow\/wp-content\/uploads\/2020\/12\/set-java-home.png\" alt=\"\" data-id=\"187\" data-full-url=\"http:\/\/bhtinstitute.com\/knowhow\/wp-content\/uploads\/2020\/12\/set-java-home.png\" data-link=\"http:\/\/bhtinstitute.com\/knowhow\/?attachment_id=187\" class=\"wp-image-187\" srcset=\"http:\/\/bhtinstitute.com\/knowhow\/wp-content\/uploads\/2020\/12\/set-java-home.png 389w, http:\/\/bhtinstitute.com\/knowhow\/wp-content\/uploads\/2020\/12\/set-java-home-300x215.png 300w, http:\/\/bhtinstitute.com\/knowhow\/wp-content\/uploads\/2020\/12\/set-java-home-60x43.png 60w, http:\/\/bhtinstitute.com\/knowhow\/wp-content\/uploads\/2020\/12\/set-java-home-150x108.png 150w\" sizes=\"auto, (max-width: 389px) 100vw, 389px\" \/><\/figure><\/li><\/ul><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>First, check if&nbsp;JAVA_HOME&nbsp;is already set by start a CMD and issue: set JAVA_HOME If&nbsp;JAVA_HOME&nbsp;is not set, you will receive &#8220;Environment variable JAVA_HOME not defined&#8221;. Otherwise, the current setting will be shown. To set\/change&nbsp;JAVA_HOME&nbsp;in Windows: Launch &#8220;Control Panel&#8221; &#8220;System&#8221; &#8220;Advanced system settings&#8221; Switch to &#8220;Advanced&#8221; tab &#8220;Environment variables&#8221; Choose &#8220;System Variables&#8221; (for all users) To&nbsp;add&nbsp;a new [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":187,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-186","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java"],"_links":{"self":[{"href":"http:\/\/bhtinstitute.com\/knowhow\/wp-json\/wp\/v2\/posts\/186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bhtinstitute.com\/knowhow\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bhtinstitute.com\/knowhow\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bhtinstitute.com\/knowhow\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/bhtinstitute.com\/knowhow\/wp-json\/wp\/v2\/comments?post=186"}],"version-history":[{"count":2,"href":"http:\/\/bhtinstitute.com\/knowhow\/wp-json\/wp\/v2\/posts\/186\/revisions"}],"predecessor-version":[{"id":191,"href":"http:\/\/bhtinstitute.com\/knowhow\/wp-json\/wp\/v2\/posts\/186\/revisions\/191"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/bhtinstitute.com\/knowhow\/wp-json\/wp\/v2\/media\/187"}],"wp:attachment":[{"href":"http:\/\/bhtinstitute.com\/knowhow\/wp-json\/wp\/v2\/media?parent=186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bhtinstitute.com\/knowhow\/wp-json\/wp\/v2\/categories?post=186"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bhtinstitute.com\/knowhow\/wp-json\/wp\/v2\/tags?post=186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}