JAR File Not Opening On Windows? Here’s How To Fix It

JAR File Not Opening On Windows? Here’s How To Fix It.

JAR recordsdata, additionally referred to as Java Archives recordsdata, are archives of Java class recordsdata. In a nutshell, JAR recordsdata are teams of recordsdata that may comprise images, audio, visuals, and many others., and may run as a single executable program when paired with the Java Runtime Environment.

They are predominantly utilized by Java builders for coding and programming. However, jar recordsdata refusing to open is among the many points that may occur whereas using them.

Why Does My JAR File Not Open?

Here are the doable causes in your jar file refusing to open.

  • JAR file set to open with different purposes.
  • Java Runtime Environment having points.
  • Incompatible JRE or JDK model
  • Incorrect Filename Extension

How to Fix JAR File Not Opening?

There are a number of strategies you should use to repair JAR recordsdata not opening. However, earlier than you start, make sure the JAR file has the proper filename extension. To achieve this, go to the View tab and allow File identify extensions. Make positive the JAR file has .jar on the finish.

Make your manner down the record of fixes to see which one works for you. 

Set JRE as Default for JAR recordsdata

For the JAR recordsdata to be opened as a standalone program, it is advisable to have the JAVA Runtime Environment. However, if the JRE just isn’t set because the default utility for opening jar recordsdata, your laptop tries using completely different purposes to open the file and fails to take action.

So, it is best to set the JRE because the default utility for opening JAR recordsdata.

  1. Click on the particular Jar file you need to open and right-click it.
  2. Select Open with and Choose one other app.
    jar file choose morejar file choose more
  3. Check mark Always use this app to open .jar recordsdata choice.
  4. Click on More apps and Look for one more app on this computer.look for another app on this pclook for another app on this pc
  5. Navigate to C:Program FilesJavajrebin. (This is the default set up path of Java. If you have got put in it in one other folder, go there as an alternative. The JRE folder might also differ relying in your JRE model.)
  6. Select javaw.exe and hit Open.
    javawjavaw

You can even enter assoc .jar=jarfile and ftype jarfile="C:(path to your javaw.exe)" -jar "%1" %* command in an Elevated Command Prompt to set JRE because the default utility.

For Example:
ftype jarfile="C:Program FilesJavajre1.8.0_341binjavaw.exe”

However, it is advisable to make sure that of the next issues.

  • Enter the instructions in the identical order.
  • Ensure to enter the listing path to your JRE within the second command.
  • Make positive the trail is ready to your JRE as an alternative of JDK.

Use Command Prompt

You can even simply open jar recordsdata using command strains within the Command Prompt.

Here’s how you are able to do it:

  1. Launch Run Utility using Windows key + R key.
  2. Enter cmd to open Command Prompt.
  3. In Command Prompt, kind cd and enter the listing to your .jar file. (If the .jar file is on one other drive, it is advisable to change the chosen drive by getting into the driving force letter.)
  4. If you don’t understand how to enter the folder listing in Command Prompt, you may merely drag and drop the folder from File Explorer to Command Prompt.
  5. Enter the Java -jar <Your Jar filename.jar> command.
    jar opening commandjar opening command

If your jar file is non-executable, the above technique received’t work on opening it. You would want to make use of a unique command.

  1. In Command Prompt, enter the command java -cp app.jar com.<package deal identify>.<class identify>
    non executable jar file opening commandnon executable jar file opening command
  2. If you weren’t the one to create the jar file and due to this fact have no idea the package deal identify and class identify, you may look it up on the downloaded web site.

Setup a BAT File

Another technique you should use to open .jar recordsdata is by making a .bat file scripted to open a selected file. This technique skips the conventional technique of opening the .jar file and helps resolves points like this.

Follow the steps beneath:

  1. Right-click on the empty space within the folder the place your jar file is situated and select New.
  2. Select Text Document and open the doc as is.
    new text documentnew text document
  3. Type in Java -jar <Your Jar filename.jar>
    jar file opening bat fi;ejar file opening bat fi;e
  4. Go to File > Save as.
  5. Make positive the Save as kind choice is chosen as All recordsdata.
  6. Name the textual content doc something you need, however embrace a .bat extension on the finish.save bat filesave bat file
  7. Click Save.
  8. Open the .bat file.

For non-executable .jar recordsdata, you should use the identical command as above to create a .bat file that opens it.

Use Compatible Java Version

If you have got a number of Java variations and are attempting to open a jar file made in a unique model of Java from the one you’re using to open it, the jar file could not open. While Java is meant to be backward suitable, you should still face this problem generally.

To remedy this, you need to outline a suitable model with which the jar file ought to open.

Here’s how you are able to do it:

  1. Right-click your jar file and faucet on Create shortcut.jar file create shortcutjar file create shortcut
  2. Right-click the shortcut and choose Properties.
  3. Next to goal, enter the next: “C:(path to your compatible jdk or jre version)” -jar “C:(path to your jarfile.jar)”
    For e.g. "C:Program FilesJavajre1.8.0_341binjavaw.exe" -jar "C:UsersUsernameDownloadsmyjarfile.jar"
    shotcut targetshotcut target
  4. Click Apply and OK.
  5. Open the shortcut.

You can even use this technique within the Command immediate or create a bat file to open jar recordsdata.

Reinstall JAVA Runtime Environment

The jar recordsdata can’t begin as a standalone program with out JRE, so JRE should be working correctly to open jar recordsdata.

If there are any errors in JAVA Runtime Environment, you may reinstall a clear new copy to nullify any points plaguing it.

Follow the steps beneath to reinstall it:

  1. Access Settings from the Start menu.
  2. Navigate to Apps > Apps & options.
  3. Locate Java and click on on choices button on the left.
  4. Select Uninstall and make sure Uninstall.
    uninstall java 8uninstall java 8
  5. Download the newest Java construct from its official web site.
  6. Run the setup file to put in Java.
    install java 8install java 8

Run Jarfix

Jarfix is a legit software program that many Java builders use to troubleshoot points with jar recordsdata. So, you may run Jarfix to repair points together with your jar recordsdata, together with points like jar recordsdata refusing to open.

It is a light-weight program and doesn’t use many system sources. However, make sure to obtain this program from a trusted web site.


Check out more article on – How-To tutorial and latest highlights on – Technical News