Windows 10: .jar files keep closing when I open them

Discus and support .jar files keep closing when I open them in Windows 10 Network and Sharing to solve the problem; I’m trying to edit an executable jar file with java runtime environment, but when I do either through cmd, bat files and opening straight through java... Discussion in 'Windows 10 Network and Sharing' started by Reesedoesgaming, May 11, 2021.

  1. .jar files keep closing when I open them


    I’m trying to edit an executable jar file with java runtime environment, but when I do either through cmd, bat files and opening straight through java it opens for a split second and then closes, and when I open through cmd Java -jar filename.jar it says it’s unable to access the file, I have the most recent java runtime, and already uninstalled and Reinstalled twice,I tried jarfix, and all to no avail. Ps it’s a minecraft mod file

    :)
     
    Reesedoesgaming, May 11, 2021
    #1

  2. .jar files open and close immediately

    Hello RYAN71098,

    1. Reinstall or update Java Runtime Environment

    If you can’t run jar files on your Windows 10 PC, you might need to reinstall Java Runtime Environment. To do that, follow these steps:

    Press Windows Key + I to open the Settings app.

    When the Settings app opens, go to the System section. Now, choose Apps & features from the left pane.

    Locate Java from the list and choose the Uninstall option.

    After doing that, navigate to Java’s website and download the latest version of the software. Once installed, check if the problem is resolved.

    Java will also automatically check for updates, and if updates are available you’ll get a notification. To update Java, simply click the notification and choose the Update option. Now follow the instructions to complete the update.

    2. Set file association

    Jar files can’t run on your PC if you don’t have the proper associations. For example, jar files can be associated to run with other applications or they could lack file association completely.

    If the situation is the latter one, you won’t be able to run jar files on your PC. However, you can easily fix this problem by changing the file association for jar files. To do that, follow these steps:

    Open the Settings app. Navigate to the System > Default apps.

    Scroll all the way down and select Choose default apps by file type.

    Locate the .jar file type and choose a default application.

    3. Create a .bat file

    According to users, you can run jar files on Windows 10 by using this simple workaround. This solution requires you to create a .bat file and use it every time you want to run a specific jar file. The process is rather simple and you can do it by following
    these steps:

    Locate your jar file. In the same folder, create a new Notepad file. To do that, right-click empty space in the directory and choose New > Text Document.

    When Notepad opens, enter java -jar filename.jar. Be sure to replace filename.jar with the actual name of the file.

    Navigate to the File > Save as.

    Set Save as type to All files. Now, enter the desired name for the file. Keep in mind that you need to have .bat as an extension or else the solution won’t work. Save the file in the same location where your jar file is located.

    After doing that, locate your .bat file and double-click it. Your jar file will now open. Keep in mind that you need to repeat this process for every jar file that you want to run on your PC. In addition, be sure to save the .bat file in the same location as
    your jar file.

    Hope it helps, have a good day
     
    ManuelCapiro, May 11, 2021
    #2
  3. DaveM121 Win User
    jar files

    Fixing .jar file opening on Windows requires two steps:

    • Open the Control Panel, and chose "Default Programs - Associate a File type or protocol with a program". Find .jar extension (Executable JAR file) there, and pick Java as default program to open this extension. It will probably be listed as "Java Platform(SE)".
      A faster alternative perhaps is straightforward right-click on a .jar file, and then change associated program by clicking on the "Change..." button.
    • Now open the regedit, and open the HKEY_CLASSES_ROOT\jarfile\shell\open\command key. Luckilly for us, we may specify parameters there for the (Default) value. This is normally: C:\Program Files\Java\jre7\bin\javaw.exe" -jar "%1" %*

    I Hope this Answers your Question!
     
    DaveM121, May 11, 2021
    #3
  4. .jar files keep closing when I open them

    .jar files opening in internet explorer

    Hi Robert,

    Welcome to Microsoft Community.

    I understand that .jar files opens in Internet Explorer by default and downloads again on Windows 10. I will certainly help you.

    I suggest you to follow the below steps and check if it resolves the issue.

    1. Right click on the .jar file, select Open with
    and click on Choose another app.

    2. Select the app you want to open the .jar file from list.

    3. If required, highlight the app and check the option
    Always use this app to open, click OK.

    Hope this helps. If the issue remains unresolved, please get back to us and we would be happy to help.
     
    Vinodh_Kumar V, May 11, 2021
    #4
Thema:

.jar files keep closing when I open them

Loading...
  1. .jar files keep closing when I open them - Similar Threads - jar files keep

  2. I Can't Open Jar files

    in Windows 10 Network and Sharing
    I Can't Open Jar files: Hey, I can't open Jar files or more exactly Optifine files, instead of running the install Optifine launcher it opens Jar files with internet explorer of all thing, I have tried to reset default apps, but I still can't get it to work, I want to be able to open Jar files in...
  3. jar file not opening

    in Windows 10 BSOD Crashes and Debugging
    jar file not opening: why the hell wont my file open? i have tried literally everything [ATTACH] https://answers.microsoft.com/en-us/windows/forum/all/jar-file-not-opening/867eeb37-c1d0-4185-9ad9-2f9ae95e531d
  4. .Jar files not opening

    in Windows 10 Ask Insider
    .Jar files not opening: ive tried everything, jarfix CMD pathing , BAT file, javaw.exe fucking nothing. submitted by /u/jmantechno [link] [comments] https://www.reddit.com/r/Windows10/comments/l8afe2/jar_files_not_opening/
  5. Jar File not Opening

    in Windows 10 Network and Sharing
    Jar File not Opening: So I have installed Minecraft Java 1.16.4 on my Windows 10 and I have tried to install Optifine 1.16.4 on it and I got it where the icon is the jar teacup with the smoke and every time I try to install it it says there was an error in the following sequence that has a...
  6. I can't open jar files

    in Windows 10 Ask Insider
    I can't open jar files: I wanted to install forge to get mods in minecraft but the jar files won't launch. I tried using cmd, creating a bat file and using jarfix. Nothing worked. All it does is create a new text document which says: JVM info: Oracle Corporation - 1.8.0_271 - 25.271-b09...
  7. I can't open jar files

    in Windows 10 Gaming
    I can't open jar files: I wanted to install forge to get mods in minecraft but the jar files won't launch. I tried using cmd, creating a bat file and using jarfix. Nothing worked. All it does is create a new text document which says: JVM info: Oracle Corporation - 1.8.0_271 - 25.271-b09...
  8. .jar files open and close immediately

    in Windows 10 Network and Sharing
    .jar files open and close immediately: I'm trying to download Minecraft forge, and It gives me a .jar file. I accidently set it to open with Photoshop, so I set it to open with Java, but when I try to open it, it opens, then closes immediately. When I try to force it open by clicking, it opens into cmd. I have the...
  9. .jar file opens with wordpad.

    in Windows 10 Ask Insider
    .jar file opens with wordpad.: So recently I may have done something stupid. I'm not sure what I did but when I try to open a file with Java it opens on wordpad for some reason. I tried changing it to Java but I can't find Java. Is there anything I can do to fix this? submitted by /u/Koufpa [link]...
  10. Windows keeps files open in memory after I have closed them

    in Windows 10 Network and Sharing
    Windows keeps files open in memory after I have closed them: Windows continues to mandate how I may work. Before shutting down, I save and close any files or worksheets I have been using. The program closes. I then perform shut down and it shows nothing open. The next time I boot up my computer, windows automatically opens the programs...