{"id":11614,"date":"2020-09-26T12:27:12","date_gmt":"2020-09-26T18:27:12","guid":{"rendered":"https:\/\/sanuja.com\/blog\/?p=11614"},"modified":"2020-09-26T12:27:12","modified_gmt":"2020-09-26T18:27:12","slug":"javac-is-not-recognized-as-an-internal-or-external-command","status":"publish","type":"post","link":"https:\/\/sanuja.com\/blog\/javac-is-not-recognized-as-an-internal-or-external-command","title":{"rendered":"\u2018javac\u2019 is not recognized as an internal or external command"},"content":{"rendered":"<p>The <em>\u2018javac\u2019 is not recognized as an internal or external command, operable program or batch file<\/em> is a very common error when you first install Java JDK on Windows machines. Here is how you can fix it.<\/p>\n<p><figure id=\"attachment_11615\" aria-describedby=\"caption-attachment-11615\" style=\"width: 619px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/cmd_javac_not_recognized.jpg\"><img decoding=\"async\" data-attachment-id=\"11615\" data-permalink=\"https:\/\/sanuja.com\/blog\/javac-is-not-recognized-as-an-internal-or-external-command\/cmd_javac_not_recognized\" data-orig-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/cmd_javac_not_recognized.jpg\" data-orig-size=\"619,117\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Sanuja Senanayake&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1601108936&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"cmd_javac_not_recognized\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;CMD javac error message.&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/cmd_javac_not_recognized-300x57.jpg\" data-large-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/cmd_javac_not_recognized.jpg\" src=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/cmd_javac_not_recognized.jpg\" alt=\"\u2018javac\u2019 is not recognized as an internal or external command\" width=\"619\" height=\"117\" class=\"size-full wp-image-11615\" srcset=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/cmd_javac_not_recognized.jpg 619w, https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/cmd_javac_not_recognized-300x57.jpg 300w\" sizes=\"(max-width: 619px) 100vw, 619px\" \/><\/a><figcaption id=\"caption-attachment-11615\" class=\"wp-caption-text\">CMD javac error message.<\/figcaption><\/figure><!--more--><\/p>\n<h3>Find javac location<\/h3>\n<p>Find the location of your Java JDK install where javac resides. Typically it will be something similar to: <em>C:\\Program Files\\Java\\jdk-XX.X.X\\bin<\/em>. Copy the location path of the folder.<br \/>\n<figure id=\"attachment_11616\" aria-describedby=\"caption-attachment-11616\" style=\"width: 617px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/java_jdk_location.jpg\"><img decoding=\"async\" data-attachment-id=\"11616\" data-permalink=\"https:\/\/sanuja.com\/blog\/javac-is-not-recognized-as-an-internal-or-external-command\/java_jdk_location\" data-orig-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/java_jdk_location.jpg\" data-orig-size=\"617,186\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"java_jdk_location\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Java JDK javac location.&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/java_jdk_location-300x90.jpg\" data-large-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/java_jdk_location.jpg\" src=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/java_jdk_location.jpg\" alt=\"Java JDK javac location.\" width=\"617\" height=\"186\" class=\"size-full wp-image-11616\" srcset=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/java_jdk_location.jpg 617w, https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/java_jdk_location-300x90.jpg 300w\" sizes=\"(max-width: 617px) 100vw, 617px\" \/><\/a><figcaption id=\"caption-attachment-11616\" class=\"wp-caption-text\">Java JDK javac location.<\/figcaption><\/figure><\/p>\n<p>If you do not find the folder, search &#8220;javac&#8221; in your C drive and open the file location.<\/p>\n<h3>Solution 1: Update the system variable PATH from GUI<\/h3>\n<p>1) Type <em>Environment<\/em> on the Windows search and open <em>Edit the system environment variables<\/em>. This will open System Properties window.<br \/>\n<figure id=\"attachment_11617\" aria-describedby=\"caption-attachment-11617\" style=\"width: 328px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/search_enviro.jpg\"><img decoding=\"async\" data-attachment-id=\"11617\" data-permalink=\"https:\/\/sanuja.com\/blog\/javac-is-not-recognized-as-an-internal-or-external-command\/search_enviro\" data-orig-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/search_enviro.jpg\" data-orig-size=\"328,584\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"search_enviro\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Windows Search for Environment.&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/search_enviro-168x300.jpg\" data-large-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/search_enviro.jpg\" src=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/search_enviro.jpg\" alt=\"Windows Search for Environment.\" width=\"328\" height=\"584\" class=\"size-full wp-image-11617\" srcset=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/search_enviro.jpg 328w, https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/search_enviro-168x300.jpg 168w\" sizes=\"(max-width: 328px) 100vw, 328px\" \/><\/a><figcaption id=\"caption-attachment-11617\" class=\"wp-caption-text\">Windows Search for Environment.<\/figcaption><\/figure><\/p>\n<p>2) Under <em>Advanced<\/em> tab, select <em>Environment Variables&#8230;<\/em>. This will open the Environment Variables window.<br \/>\n<figure id=\"attachment_11621\" aria-describedby=\"caption-attachment-11621\" style=\"width: 409px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/sys_properties.jpg\"><img decoding=\"async\" data-attachment-id=\"11621\" data-permalink=\"https:\/\/sanuja.com\/blog\/javac-is-not-recognized-as-an-internal-or-external-command\/sys_properties\" data-orig-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/sys_properties.jpg\" data-orig-size=\"409,464\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"sys_properties\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Windows System Properties&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/sys_properties-264x300.jpg\" data-large-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/sys_properties.jpg\" src=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/sys_properties.jpg\" alt=\"Windows System Properties\" width=\"409\" height=\"464\" class=\"size-full wp-image-11621\" srcset=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/sys_properties.jpg 409w, https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/sys_properties-264x300.jpg 264w\" sizes=\"(max-width: 409px) 100vw, 409px\" \/><\/a><figcaption id=\"caption-attachment-11621\" class=\"wp-caption-text\">Windows System Properties<\/figcaption><\/figure><\/p>\n<p>3) Highlight <em>Path<\/em> and select <em>Edit&#8230;<\/em> to open Edit environment variable window.<br \/>\n<figure id=\"attachment_11623\" aria-describedby=\"caption-attachment-11623\" style=\"width: 618px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/environment_variables.jpg\"><img decoding=\"async\" data-attachment-id=\"11623\" data-permalink=\"https:\/\/sanuja.com\/blog\/javac-is-not-recognized-as-an-internal-or-external-command\/environment_variables\" data-orig-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/environment_variables.jpg\" data-orig-size=\"618,585\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"environment_variables\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Windows Environment Variables&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/environment_variables-300x284.jpg\" data-large-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/environment_variables.jpg\" src=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/environment_variables.jpg\" alt=\"Windows Environment Variables\" width=\"618\" height=\"585\" class=\"size-full wp-image-11623\" srcset=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/environment_variables.jpg 618w, https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/environment_variables-300x284.jpg 300w\" sizes=\"(max-width: 618px) 100vw, 618px\" \/><\/a><figcaption id=\"caption-attachment-11623\" class=\"wp-caption-text\">Windows Environment Variables<\/figcaption><\/figure><\/p>\n<p>4) With Path selected, click <em>Edit..<\/em> and the javac path you found in your computer.<\/p>\n<figure id=\"attachment_11624\" aria-describedby=\"caption-attachment-11624\" style=\"width: 527px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/edit_javac_path.jpg\"><img decoding=\"async\" data-attachment-id=\"11624\" data-permalink=\"https:\/\/sanuja.com\/blog\/javac-is-not-recognized-as-an-internal-or-external-command\/edit_javac_path\" data-orig-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/edit_javac_path.jpg\" data-orig-size=\"527,501\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"edit_javac_path\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Adding javac path in environment variable.&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/edit_javac_path-300x285.jpg\" data-large-file=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/edit_javac_path.jpg\" src=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/edit_javac_path.jpg\" alt=\"Adding javac path.\" width=\"527\" height=\"501\" class=\"size-full wp-image-11624\" srcset=\"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/edit_javac_path.jpg 527w, https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/edit_javac_path-300x285.jpg 300w\" sizes=\"(max-width: 527px) 100vw, 527px\" \/><\/a><figcaption id=\"caption-attachment-11624\" class=\"wp-caption-text\">Adding javac path in environment variable.<\/figcaption><\/figure>\n<h3>Solution 2: Update the system variable PATH from CMD<\/h3>\n<p>Open Windows Command Prompt (CMD) and enter the following an press Enter,<br \/>\n<em>set PATH = %PATH%;&#8221;<em>C:\\Program Files\\Java\\jdk-XX.X.X\\bin<\/em><\/em>.<\/p>\n<p>Please note you must replace C:\\Program Files\\Java\\jdk-XX.X.X\\bin with the path you found in your computer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The \u2018javac\u2019 is not recognized as an internal or external command, operable program or batch file is a very common error when you first install Java JDK on Windows machines. Here is how you can fix it.<\/p>\n","protected":false},"author":2,"featured_media":11616,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[48],"class_list":["post-11614","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-computer-science","tag-java"],"jetpack_featured_media_url":"https:\/\/sanuja.com\/blog\/wp-content\/uploads\/2020\/09\/java_jdk_location.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/posts\/11614","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/comments?post=11614"}],"version-history":[{"count":0,"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/posts\/11614\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/media\/11616"}],"wp:attachment":[{"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/media?parent=11614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/categories?post=11614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sanuja.com\/blog\/wp-json\/wp\/v2\/tags?post=11614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}