Windows 10: .jar files open and close immediately

Discus and support .jar files open and close immediately in Windows 10 Network and Sharing to solve the problem; 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... Discussion in 'Windows 10 Network and Sharing' started by Godsmacker78, Nov 24, 2020.

  1. .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 latest version of Java, and I have redownloaded it countless times, reset my computer, and I'm lost. I tried to make a .bat file but either I did it wrong or it didn't work, does anyone have a way to fix this that isn't too complicated? Or if it is, someone with very limited knowledge on computers can follow?

    :)
     
    Godsmacker78, Nov 24, 2020
    #1
  2. ryan71098 Win User

    .jar files open and close immediately

    Hi,

    I am trying to download a .jar file, however, when I try to open it, it opens very quickly and closes immediately. I am opening it with the latest version of Java so I'm not sure what the problem could be. I am doing this on a new laptop if that helps.
    Thank you!
     
    ryan71098, Nov 24, 2020
    #2
  3. .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, Nov 24, 2020
    #3
  4. DaveM121 Win User

    .jar files open and close immediately

    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, Nov 24, 2020
    #4
Thema:

.jar files open and close immediately

Loading...
  1. .jar files open and close immediately - Similar Threads - jar files open

  2. .jar files open and close immediately WINDOWS 11 08/26/2023

    in Windows 10 Gaming
    .jar files open and close immediately WINDOWS 11 08/26/2023: I am trying to run the Optifine file for Minecraft on Java Platform SE Binary, and the file opens and closes immediately without any error or warning messages. I have troubleshooted the problem with multiple sources, and no success. I uninstalled Java and reinstalled it, set...
  3. .jar files open and close immediately WINDOWS 11 08/26/2023

    in Windows 10 Software and Apps
    .jar files open and close immediately WINDOWS 11 08/26/2023: I am trying to run the Optifine file for Minecraft on Java Platform SE Binary, and the file opens and closes immediately without any error or warning messages. I have troubleshooted the problem with multiple sources, and no success. I uninstalled Java and reinstalled it, set...
  4. .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...
  5. .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...
  6. .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...
  7. Chrome opens but immediately closes

    in Windows 10 Network and Sharing
    Chrome opens but immediately closes: chrome opens but it immediately closes sometimes it will stay open for 5 mins or all day without closing but it will happen constantly the next day until I reset my computersometimes that doesn't even work or clear all my cache which again sometimes doesn't work it's just...
  8. 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
  9. .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/
  10. 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...

Users found this page by searching for:

  1. MY JAVA IS OPENING THEN CLOSEST IMMEDIATELY WHAT SHOULD I DO

    ,
  2. java closing instantly

    ,
  3. open forge close instantly

    ,
  4. Windows 10 jar file flashes then closes