Easiest route is probably upgrading or re-installing the Java Runtime Environment (JRE).

Or this:

  • Open the Windows Explorer, from the Tools select 'Folder Options...'
  • Click the File Types tab, scroll down and select JAR File type.
  • Press the Advanced button.
  • In the Edit File Type dialog box, select open in Actions box and click Edit...
  • Press the Browse button and navigate to the location the Java interpreter javaw.exe.
  • In the Application used to perform action field, needs to display something similar to C:\Program Files\Java\j2re1.4.2_04\bin\javaw.exe" -jar "%1" % (Note: the part starting with 'javaw' must be exactly like that; the other part of the path name can vary depending on which version of Java you're using) then press the OK buttons until all the dialogs are closed.

Which was stolen from here: http://windowstipoftheday.blogspot.com/2005/10/setting-jar-file-association.html

Answer from Brian Kelly on Stack Overflow
🌐
TheServerSide
theserverside.com › blog › Coffee-Talk-Java-News-Stories-and-Opinions › Run-JAR-file-example-windows-linux-ubuntu
How to run a Jar file
How do you run a JAR file on Windows, Mac or Linux? Double click the JAR? Run the JAR at the command line? Several approaches will work if you have Java or the JDK installed.
Discussions

java - how to run or install a *.jar file in windows? - Stack Overflow
I have downloaded jbpm-installer-3.2.7.jar but I don't know how to install or run the file. If I double click on it, it opens in winrar. I tried installing through command prompt, but I got the More on stackoverflow.com
🌐 stackoverflow.com
How do I run .jar programs on linux in general?
Doesn't OpenJDK allow it if you do java -jar ? But it's also possible that a jar isn't executable, this is especially common with Minecraft mods More on reddit.com
🌐 r/linux4noobs
15
0
November 29, 2024
executable jar - Do you need java installed to run jar files? - Stack Overflow
I want to create a executable jar file of a small game that i wrote in java and make it playable in any machine with simple double click like exe file. My question is do you need to install java ru... More on stackoverflow.com
🌐 stackoverflow.com
How run .jar file
You need to install Java to run .jar files. More on reddit.com
🌐 r/windows
10
9
April 9, 2017
🌐
Talentelgia
talentelgia.com › home › software development › step-by-step guide to run a .jar file
Step-by-Step Guide to Run a .JAR File
April 20, 2026 - If you are just getting started with JAR’s then following these steps will prevent the most common errors, and make running JAR files seamless: Download and install the Java Runtime ...
🌐
Windows Report
windowsreport.com › how to › file opener › run a jar file
How to Run a JAR File on Windows: 5 Easy Methods
December 20, 2023 - Type cmd in the Windows Search tab and click on the Command Prompt app. Next, input the following command and press Enter to run it: java -version · The current version of Java is Version 8 Update 311.
🌐
Wikihow
wikihow.com › computers and electronics › software › how to run a .jar java file: 10 steps (with pictures) - wikihow
How to Run a .Jar Java File: 10 Steps (with Pictures) - wikiHow
February 19, 2026 - Download and install Java on your computer, and make sure it's updated to the current version. Double-click on the JAR file to open it with Java. If it doesn't open, double-check that it's an executable file.
🌐
How-To Geek
howtogeek.com › home › windows › how to open jar files on windows 10 and 11
How to Open JAR Files on Windows 10 and 11
September 23, 2023 - To run a JAR file on Windows 10 or Windows 11, right-click it, then select Open With > Java Platform SE Binary. Alternatively, you can view or extract the contents of a JAR file by opening it in a program like WinRAR.
Find elsewhere
🌐
LinuxConfig
linuxconfig.org › home › how to run jar file on linux
Install Java JRE & Run JAR Files on Linux
September 21, 2025 - Learn how to install Java JRE on Linux and run JAR files seamlessly via GUI or command line. A step-by-step guide for all major distros.
🌐
Computer Hope
computerhope.com › issues › ch001343.htm
How to Open a Jar File
To run the file (Java Runtime Environment). To view the file (decompression). Related information. To run the jar file, you must download and install the Java Runtime Environment (if you do not have it already) from the link below.
🌐
TheServerSide
theserverside.com › blog › Coffee-Talk-Java-News-Stories-and-Opinions › How-to-open-a-JAR-file
How to open a JAR file
You can open JAR files with any ZIP utility. A JAR file is just a special type of ZIP file. And to run a Java JAR file, just install Java and either double-click it or run the JAR file at the ...
🌐
Reddit
reddit.com › r/linux4noobs › how do i run .jar programs on linux in general?
r/linux4noobs on Reddit: How do I run .jar programs on linux in general?
November 29, 2024 -

I run gentoo, and have installed a dual boot of debian 12 to confirm that just installing java, jre, and openjdk does in fact not allow me to run .jar programs.

I am trying to install fabric to minecraft so I can add some mods to minecraft I want. Except that even with the software from here: https://wiki.gentoo.org/wiki/Java

and from here: https://packages.gentoo.org/packages/dev-java/openjdk

does not give me any program to open my fabric installer jar program to install it with. I have set the jar as a executable, but it still won't let me open it with any java programs. There are none.

Any help, even lazy help, is appreciated. Thank you for reading

FIX: you run them in terminal, which confused me since the tutorial I watched showed it as a program. Thanks for the help people. Haven't modded minecraft since I used windows

Top answer
1 of 9
314

The . syntax can only be used to run (by "sourcing") shell scripts.

You'll need to use the java command to run a .jar file:

java -jar Minecraft.jar

If you don't have java installed, you can fix that by installing the default-jre¹ package. You can see if you already have java installed by running in a terminal:

java -version 

[1]: This will install the default openjdk Java runtime. You can use openjdk-8-jre, or openjdk-7-jre, or openjdk-6-jre instead, if you prefer - whichever is available on your version of Ubuntu.

2 of 9
46

Linux is perfectly capable of running a foreign binary, like a JAR file. This is how Wine works, for example. To run JAR files as executable first make sure you have Java installed, then do the following in a console:

  1. Install binfmt-support Support for extra binary formats:

    The binfmt_misc kernel module, contained in versions 2.1.43 and later of the Linux kernel, allows system administrators to register interpreters for various binary formats based on a magic number or their file extension, and cause the appropriate interpreter to be invoked whenever a matching file is executed. Think of it as a more flexible version of the #! executable interpreter mechanism.

    sudo apt-get install binfmt-support
    
  2. cd to your JAR file and change it to executable (you can also do this through file properties in Nautilus)

    chmod a+rx myjar.jar
    
  3. Run your jar file just as if it was any other binary executable or shell script

    ./myjar.jar
    

Note: Be sure you have binfmt_misc Linux kernel module loaded. If you use your custom compiled kernel without this module, binfmt-support won't work.

Top answer
1 of 4
25

You have two options


  1. Use jPortable together with jPortable Launcher

    jPortable Launcher allows you to easily run Java JARs from your PortableApps.com-enabled device with the jPortable portable Java Runtime Environment installed.

    To use this, visit PortableApps.com and search for jPortable . A list of result should come up and then select the runtime environment and the launcher (links above). Then download both of them, and install per directions. A folder will be created where the downloaded files were run from. Inside one of them will be "JavaPortableLauncher.exe". If you launch it, you should be able to locate and open a jar file with the application.

(or)

  1. Download and extract the Windows x86 tar.gz version and start your .JAR file from commmand line: start C:\Java\bin\javaw.exe -jar C:\myfolder\myprogram.jar
2 of 4
7

I remember that severel years ago you could download Java, unzip it, put it somewhere in a folder, and by pointing to the java executable in that folder you could run java. I don't know how it works today with the current versions, but I wouldn't be surprised if it still could work like that. Don't have Windows here, so can't test it, but you can download a zip (or tar.gz) file, unzip that and than work from there. If you can't unzip gz files, download and install 7-zip.

This won't install it like you normally do, so no update alerts etc, no browser integration, no system variables, but you need something to run that code, and this is the least I think.

http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

Download one of the tar.gz versions.

🌐
The Windows Club
thewindowsclub.com › the windows club › how to open or run a jar file on windows 11/10
How to open or run a JAR file on Windows 11/10
You’ll need to use the java command to run a .jar file · Add TheWindowsClub as a Preferred Source on Google Search ... If you don’t have java installed, you can fix that by installing the default-jre package.
Published   January 6, 2024
🌐
Guru99
guru99.com › home › java tutorials › how to open a jar file in windows, online
How to Open a JAR File in Windows, Online
July 28, 2025 - You need a Java Runtime Environment(JRE) to run a JAR file format. If you already have JRE installed in your system, you only need to double-click the JAR file, and it will start running.
🌐
UbuntuMint
ubuntumint.com › home › uncategorized › how to run jar files in ubuntu
How to Run [Execute] Jar Files on Ubuntu
May 18, 2024 - Just remember to check your Java installation, navigate to the JAR file’s directory, and use the `java -jar` command. With these steps, you should be able to run any Java application packaged as a JAR file on your Ubuntu system.
🌐
Linux Mint Forums
forums.linuxmint.com › board index › main edition support › beginner questions
[SOLVED] How to run a .jar file - Linux Mint Forums
September 10, 2020 - Execute the commandline java -jar forge-1.12.2-14.23.5.2854-universal.jar in this terminal window. -- Note: The steps given by ajgringo619 above · ajgringo619 wrote: Fri Sep 11, 2020 8:29 pm should work. They do here. In case Java simply does not start on your system, then this may be a hint that Java has not been installed correctly perhaps. The people of Alderaan have been desperately fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for full 4 years now. ... Use the Thunar file manager and navigate to the directory where the file forge-1.12.2-14.23.5.2854-universal.jar has been saved.