{"id":26798,"date":"2022-07-01T18:38:18","date_gmt":"2022-07-01T13:08:18","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/?p=26798"},"modified":"2023-07-31T20:33:09","modified_gmt":"2023-07-31T15:03:09","slug":"repair-jar-file-association-windows","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/repair-jar-file-association-windows\/","title":{"rendered":"How to Fix .JAR (Executable Jar File) File Association in Windows"},"content":{"rendered":"<p>Jar (Java ARchive) or &#8220;executable Jar file&#8221; is executed by Java Runtime Environment (javaw.exe) program. On Windows, the Java Runtime Environment&#8217;s setup will register a default association for Jar files so that double-clicking a Jar file on the desktop will automatically run it with &#8220;<code>javaw.exe -jar<\/code>&#8221; command-line argument.<!--more--><\/p>\n<p>A third-party application (especially unzip tools) may overtake the JAR file association in some cases. Note that Java ARchive (or executable Jar) files are built on the ZIP format and typically have a .jar file extension. The .Jar file may show up with a wrong icon which indicates that the file association is incorrect.<\/p>\n<p>Since .Jar files need to be run with the special command-line argument as explained above, simply reassociating the .Jar files via the Open with dialog won&#8217;t help.<\/p>\n<p>You may be wondering how to repair or restore the .JAR file association (i.e., set default double-click action to Java Runtime Environment program) in Windows.<\/p>\n<div id=\"toc\"><strong>Fix .Jar File Association<\/strong><\/p>\n<ul>\n<li><a href=\"#jarfix\">Method 1: Using the &#8220;JarFix&#8221; Utility<\/a><\/li>\n<li><a href=\"#commands\">Method 2: Using ASSOC AND FTYPE commands<\/a><\/li>\n<li><a href=\"#regedit\">Method 3: Using the Registry Editor<\/a><\/li>\n<li><a href=\"#regfile\">Method 4: Using a Registry (.REG) file<\/a><\/li>\n<li><a href=\"#reinstall_jre\">Method 5: Reinstalling Java Runtime Environment<\/a><\/li>\n<\/ul>\n<\/div>\n<h2>[Fix] .JAR (Executable Jar File) File Association in Windows<\/h2>\n<p>There are several ways to fix the .JAR file association in Windows. Follow one of the methods below:<\/p>\n<h3><a id=\"jarfix\"><\/a>Method 1: Using the &#8220;JarFix&#8221; Utility<\/h3>\n<p>If you double-click on a jar file, and your Java application does not start, your .jar association has been hijacked. You can fix the problem with Jarfix.<\/p>\n<pre>Download Jarfix:\nhttps:\/\/johann.loefflmann.net\/en\/software\/jarfix\/index.html#Download<\/pre>\n<p>This little portable app automatically finds the Javaw.exe location (by finding the current Java version and Java Home path from the registry) and fixes the .JAR file association settings in the registry.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26799\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/07\/jarfix.png\" alt=\"jarfix - repair .jar file association settings\" width=\"492\" height=\"368\" \/><\/p>\n<p>There you go! JAR files are now showing up with the Java coffee cup icon.<\/p>\n<hr \/>\n<div class=\"qt\">\n<h4>Note down the Java Home Path<\/h4>\n<p><strong>Note:<\/strong> Before proceeding to the following methods, you need to locate the path to javaw.exe. You can easily locate the file by browsing the &#8220;<code>Program Files\\Java<\/code>&#8221; directory.<\/p>\n<p>Alternately, you can run the following command in the Command Prompt window to locate the path to <code>Javaw.exe<\/code>:<\/p>\n<pre>reg query hklm\\software\\javasoft \/v javahome \/s<\/pre>\n<p>The above command searches and queries the <code>JavaHome<\/code> value in the Windows registry which stores the information we need.<\/p>\n<p>For illustrative purposes in this article, let&#8217;s assume the file <code>Javaw.exe<\/code> is located here:<\/p>\n<pre>C:\\Program Files\\Java\\jre1.8.0_333\\bin\\javaw.exe<\/pre>\n<\/div>\n<hr \/>\n<h3><a id=\"commands\"><\/a>Method 2: Using ASSOC AND FTYPE commands<\/h3>\n<p>To fix the .Jar file association using command-line, open an <a href=\"https:\/\/www.winhelponline.com\/blog\/open-elevated-command-prompt-windows\/\">admin Command Prompt<\/a> and run the following commands one by one:<\/p>\n<pre>assoc .jar=jarfile\n\nftype jarfile=\"C:\\Program Files\\Java\\jre1.8.0_333\\bin\\javaw.exe\" -jar \"%1\" %*\n\nreg delete \"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.jar\" \/f<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26800\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/07\/jar-asso-fix-commands.png\" alt=\"repair .jar file association settings using ftype and assoc commands\" width=\"738\" height=\"279\" \/><\/p>\n<p><strong>Notes:<\/strong><\/p>\n<ul>\n<li>If the path to javaw.exe is different in your case (perhaps due to a different JRE version), input the correct folder name in the 2nd command.<\/li>\n<li>Please ignore if the 3rd command returns the following error:\n<pre class=\"err\">ERROR: The system was unable to find the specified registry key or value.<\/pre>\n<\/li>\n<\/ul>\n<hr \/>\n<h3><a id=\"regedit\"><\/a>Method 3: Using the Registry Editor<\/h3>\n<ol>\n<li>Start the Registry Editor (<code>regedit.exe<\/code>)<\/li>\n<li>Go to the following location:\n<pre>HKEY_CLASSES_ROOT\\.Jar<\/pre>\n<\/li>\n<li>Double-click <code>(default)<\/code> and set its data as &#8220;<code>jarfile<\/code>&#8221; (without quotes)<\/li>\n<li>Go to the following location:\n<pre>HKEY_CLASSES_ROOT\\jarfile\\shell\\open\\command<\/pre>\n<\/li>\n<li>Double-click <code>(default)<\/code> and set its data to:\n<pre>\"C:\\Program Files\\Java\\jre1.8.0_333\\bin\\javaw.exe\" -jar \"%1\" %*<\/pre>\n<\/li>\n<li>Go to the following branch and expand it:\n<pre>HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\<\/pre>\n<\/li>\n<li>Check if a subkey named &#8220;<code>.jar<\/code>&#8221; exists under the &#8220;<code>FileExts<\/code>&#8221; branch. If so, right-click on the <code>.jar<\/code> subkey and choose Delete. <strong>This is an important step!<\/strong><\/li>\n<li>Exit the Registry Editor.<\/li>\n<\/ol>\n<p><em><strong>Note:<\/strong> If the path to javaw.exe is different in your case (perhaps due to a different JRE version), input the correct path to javaw.exe in Step 5 above.<\/em><\/p>\n<hr \/>\n<h3><a id=\"regfile\"><\/a>Method 4: Using a Registry (.REG) file<\/h3>\n<p>The steps listed under Method 3 can be automated using the following <a href=\"https:\/\/www.winhelponline.com\/blog\/how-to-use-reg-files-registration-entries-windows\/\">registry file<\/a>. This can be helpful especially if you want to fix the JAR file association on multiple computers.<\/p>\n<p><script src=\"https:\/\/gist.github.com\/winhelponline\/b2bc23a2ddeb79ca4015358f514d5bd4.js\"><\/script><\/p>\n<ul>\n<li>Download the above <a href=\"https:\/\/gist.github.com\/winhelponline\/b2bc23a2ddeb79ca4015358f514d5bd4\/raw\/18fdba5ec6acdcdb7f150469f2b939b6c8a7ee8a\/jarfix.reg\">jarfix.reg<\/a> registry file (use right-click \u2192 &#8220;Save target as&#8221; in your browser).\n<div class=\"newline\"><em><strong>Note:<\/strong> If the path to javaw.exe is different in your case (perhaps due to a different JRE version), input the correct folder name in the REG file. Be sure to preserve the double slashes in the REG file though.<\/em><\/div>\n<\/li>\n<li>Double-click on the Registry file to apply the settings to the registry.<\/li>\n<\/ul>\n<hr \/>\n<h3><a id=\"reinstall_jre\"><\/a>Method 5:\u00a0Reinstalling Java Runtime Environment<\/h3>\n<p>Uninstalling and then reinstalling Java Runtime Environment should add Java Home Path in <a href=\"https:\/\/www.winhelponline.com\/blog\/restore-path-environment-variable-deleted\/\">PATH environment variable<\/a> and also fix the .Jar file association settings. However, if there is a <a href=\"https:\/\/www.winhelponline.com\/blog\/remove-file-association-windows\/\">per-user override<\/a> for .Jar file type (i.e., the &#8220;FileExts&#46;jar&#8221; registry key), the JRE installer may not remove it. In that case, you need to follow one of the four methods above.<\/p>\n<p>Thats it! You should now be able to run any .Jar file by double-clicking on it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Jar (Java ARchive) or &#8220;executable Jar file&#8221; is executed by Java Runtime Environment (javaw.exe) program. On Windows, the Java Runtime Environment&#8217;s setup will register a default association for Jar files so that double-clicking a Jar file on the desktop will automatically run it with &#8220;javaw.exe -jar&#8221; command-line argument.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","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_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[6,7],"tags":[441],"class_list":["post-26798","post","type-post","status-publish","format-standard","hentry","category-utilities","category-windows","tag-registry"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":5732,"url":"https:\/\/www.winhelponline.com\/blog\/replace-notepad-text-editor-notepad-plus-association\/","url_meta":{"origin":26798,"position":0},"title":"How to Replace Notepad With Notepad++ or Other Editor","author":"Ramesh","date":"November 2, 2017","format":false,"excerpt":"If you\u2019re looking at how to replace Notepad with Notepad++ or any third-party editor, this post explains how to do it. Notepad++ is a free source code editor and Notepad replacement that supports several languages. Let\u2019s see how you can replace Notepad with Notepad++ without replacing any system files. Notepad\u2026","rel":"","context":"In &quot;Utilities&quot;","block_context":{"text":"Utilities","link":"https:\/\/www.winhelponline.com\/blog\/category\/utilities\/"},"img":{"alt_text":"notepad plus replace debugger notepad.exe","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2017\/11\/debugger-notepad-plus-switch.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2017\/11\/debugger-notepad-plus-switch.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2017\/11\/debugger-notepad-plus-switch.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2017\/11\/debugger-notepad-plus-switch.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":47665,"url":"https:\/\/www.winhelponline.com\/blog\/system32-huge-disk-space-junk-exe-files\/","url_meta":{"origin":26798,"position":1},"title":"System32 Folder Occupies 300 GB; Filled with Gibberish EXE Files","author":"Ramesh","date":"May 21, 2023","format":false,"excerpt":"Of late, many users are complaining that the System32 folder is consuming colossal disk space (e.g., 150 GB - 300 GB) all of a sudden. On a user's computer, more than 200,000 .exe files were generated. Those files were almost generated every minute, consuming over 200 GB on the C\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"system32 gibberish exe filled up microstar international","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2023\/05\/system32-junk-exe-msi-service-treesize.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2023\/05\/system32-junk-exe-msi-service-treesize.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2023\/05\/system32-junk-exe-msi-service-treesize.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2023\/05\/system32-junk-exe-msi-service-treesize.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":10607,"url":"https:\/\/www.winhelponline.com\/blog\/find-out-if-a-program-exe-file-is-32-bit-or-64-bit\/","url_meta":{"origin":26798,"position":2},"title":"How to Check if a Program (.EXE or .DLL) is 32-bit or 64-bit","author":"Ramesh","date":"August 4, 2019","format":false,"excerpt":"Software developers compile separate executable files (.EXE or .DLL) for 32-bit (x86) and 64-bit (x64) systems.\u00a0The 64-bit version of the program is usually denoted by suffixing 64 or x64 with the filename -- e.g., sigcheck.exe vs. sigcheck64.exe. In some cases, the bitness notation may be missing, and you may be\u2026","rel":"","context":"In &quot;Utilities&quot;","block_context":{"text":"Utilities","link":"https:\/\/www.winhelponline.com\/blog\/category\/utilities\/"},"img":{"alt_text":"exe or dll - compatibility tab - bitness check","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/08\/find-32-bit-or-64-bit-1.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1113,"url":"https:\/\/www.winhelponline.com\/blog\/exe-files-open-notepad-fix-association\/","url_meta":{"origin":26798,"position":3},"title":"[Fix] .EXE Files Open in Notepad or Other App when Double-clicked","author":"Ramesh","date":"March 9, 2007","format":false,"excerpt":"Summary: Double-clicking an .exe file may open Notepad or any other application, displaying junk characters. On some systems, the Open with dialog may appear when double-clicking .exe files. This article explains how to fix the .exe file association in Windows 10 and 11. Did you accidentally use the Default Programs\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"exe files open in notepad","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2007\/03\/exe_open_notepad.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2007\/03\/exe_open_notepad.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2007\/03\/exe_open_notepad.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1140,"url":"https:\/\/www.winhelponline.com\/blog\/extract-msi-contents-add-extract-all-right-click-menu\/","url_meta":{"origin":26798,"position":4},"title":"Extract Contents of .MSI File and Add &#8220;Extract All&#8221; to Right-Click Menu","author":"Ramesh","date":"January 11, 2011","format":false,"excerpt":"There are situations when you need to pick a single file from a .msi package without going through the installation phase. One good example is that a stand-alone or portable application wrapped in a .msi package. Or, you may need to extract a particular wallpaper image from a theme installer.\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":".msi extract all right-click menu","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2011\/01\/msi-extract-all-menu.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2011\/01\/msi-extract-all-menu.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2011\/01\/msi-extract-all-menu.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2011\/01\/msi-extract-all-menu.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":6078,"url":"https:\/\/www.winhelponline.com\/blog\/fix-vcruntime140-dll-missing-error-windows\/","url_meta":{"origin":26798,"position":5},"title":"[Fix] Missing VCRUNTIME140.DLL, VCRUNTIME140_1.DLL, MSVCP140.DLL","author":"Ramesh","date":"January 1, 2018","format":false,"excerpt":"On your Windows 10 or 11 computer, a 3rd party program (e.g., Epic Games) may throw the error that the module VCRUNTIME140.DLL, VCRUNTIME140_1.DLL, or MSVCP140.dll is missing from the computer. Here are the error messages which you may encounter: The program can't start because VCRUNTIME140.dll is missing from your computer.\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"powertoys runtime files","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2018\/01\/runtimes-powertoys.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2018\/01\/runtimes-powertoys.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2018\/01\/runtimes-powertoys.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2018\/01\/runtimes-powertoys.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/26798","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/comments?post=26798"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/26798\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=26798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=26798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=26798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}