Home >Java >javaTutorial >How to Make a JAR File Run with a Double-Click on Windows?

How to Make a JAR File Run with a Double-Click on Windows?

Susan Sarandon
Susan SarandonOriginal
2024-12-25 19:55:17591browse

How to Make a JAR File Run with a Double-Click on Windows?

How to Run a JAR File with a Double-Click on Windows

To execute a JAR file with double-click, follow these steps:

Check if the JRE is Installed and Upgraded

  • Ensure that you have the Java Runtime Environment (JRE) installed.
  • If not, install or upgrade it from the official Java website.

Associate JAR Files with Java

  • Open Windows Explorer.
  • Click Tools > Folder Options.
  • Select the "File Types" tab.
  • Scroll down and select "JAR" file type.
  • Click the "Advanced" button.
  • In the "Actions" box, select "open".
  • Click "Edit...".
  • In the "Application used to perform action" field, enter the following:

    C:\Program Files\Java\j2re1.4.2_04\bin\javaw.exe" -jar "%1" %
  • Note: Adjust the path as necessary based on your Java version.
  • Click "OK" until all dialogs are closed.

After completing these steps, double-clicking a JAR file should execute it using the Java runtime environment.

The above is the detailed content of How to Make a JAR File Run with a Double-Click on Windows?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn