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. .jar files opening and closing on open and all workarounds aren't working

    in Windows 10 Network and Sharing
    .jar files opening and closing on open and all workarounds aren't working: Recently i've been trying to install forge for minecraft and have tried every method i've been able to find. Upon clicking on the file a cmd prompt opens and closes immediately. I've tried reinstalling java, ive tried changing paths around, ive tried using winzip, nothing...
  3. .jar files opening and closing on open and all workarounds aren't working

    in Windows 10 Gaming
    .jar files opening and closing on open and all workarounds aren't working: Recently i've been trying to install forge for minecraft and have tried every method i've been able to find. Upon clicking on the file a cmd prompt opens and closes immediately. I've tried reinstalling java, ive tried changing paths around, ive tried using winzip, nothing...
  4. .jar files opening and closing on open and all workarounds aren't working

    in Windows 10 Software and Apps
    .jar files opening and closing on open and all workarounds aren't working: Recently i've been trying to install forge for minecraft and have tried every method i've been able to find. Upon clicking on the file a cmd prompt opens and closes immediately. I've tried reinstalling java, ive tried changing paths around, ive tried using winzip, nothing...
  5. Windows apps keep closing instantly when I try to open them

    in Microsoft Windows 10 Store
    Windows apps keep closing instantly when I try to open them: Hello,Whenever I try to open an application that was downloaded from the Microsoft store, it will automatically close.Ex. Calculator, Sticky Notes, Xbox app, even if I double click on a jpeg it will not openIve tried a number of things including:Downloading most recent...
  6. 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
  7. .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/
  8. 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...
  9. .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...
  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...