W3docs

How to open/run .jar file (double-click not working)?

To open a .jar file on a Windows system, you can do one of the following:

To open a .jar file on a Windows system, you can do one of the following:

  1. Double-click the .jar file. This should open the file if you have Java installed and the .jar extension is associated with the Java runtime. If double-clicking does nothing, manually associate the file type: right-click the .jar file → Open withChoose another app → select java.exe → check Always use this app to open .jar files.
  2. Use the java -jar command to run the .jar file. Open a command prompt and navigate to the directory containing the .jar file. Then, enter the following command:
java -jar filename.jar

Replace filename.jar with the name of your .jar file. This will run the .jar file using the Java runtime.

On macOS or Linux, open a terminal, navigate to the directory, and run the same java -jar filename.jar command.