Double-click to open the jar file on Windows

Open the jar file on Windows

When I created a jar file for distribution and distributed it, it can be easily opened by double-clicking on Mac, but it may not be opened on Windows. Here's a summary of how I made it work with a double click.

Java installation

It will not start without java, so install free java8 according to the instructions. https://java.com/ja/download/

Edit Registry Editor

This is important. Search for regedit at the magnifying glass. Once opened, HKEY_CURRENT_USER / Software / Classes / Applications / javaw.exe / shell / open / command It moves like. Double-click "(default)" and replace "" C: \ ... exe ""% 1 "" with "" C: \ ... exe "-jar"% 1 "". It can be HKEY_CLASSES_ROOT / Applications / javaw.exe / shell / open / command.

Summary

First, right-click the jar file to open it from the program → select another program → always check this app ... → run it with Java (TM) Platform SE binary. After that, you can move it by double-clicking.

Recommended Posts

Double-click to open the jar file on Windows
How to debug the generated jar file in Eclipse
How to install JDK 8 on Windows without using the installer
How to change the contents of the jar file without decompressing
Add Extended Attributes to the file
Replace the contents of the Jar file
[Java] How to update Java on Windows
[Eclipse] I want to open the same file twice [Split editor]
Add a time stamp to the JAR file name in Gradle
Create a jar file with the command
How to delete the wrong migration file
How to delete the migration file NO FILE
How to add jar file in ScalaIDE
How to change the timezone on Ubuntu
Try changing the .erb file to .slim
Pre-processing to display on the browser (compiler)
What to do if the changes are not reflected in the jar manifest file
How to share on the host side (windows) and guest side (CentOS 7) with VirtualBox
JAVA: jar, aar, view the contents of the file
[Swift 5] Processing to close the keyboard on UITableView
Migration from Eclipse to IntelliJ (on the way)
Ssh login to the app server on heroku
Add jar file obtained from Maven to IntelliJ
[Java] Memo on how to write the source
[Spring Boot] How to refer to the property file
Path of Jar file running on AWS Elastic Beanstalk
The mark on the right side of the version-controlled Xcode file
[Java] How to extract the file name from the path
[Ruby on Rails] How to change the column name
JavaFX-Specify the location of the CSS file relative to the fxml file
[Java] Get the file in the jar regardless of the environment
How to start TOMCAT by specifying JAVA_HOME on Windows
Deploy the Spring Boot project to Tomcat on XAMPP
Install MySQL 5.6 on CentOS6 [How to specify the version]
Completely delete the migration file that you failed to delete
I want to simplify the log output on Android
I want to find out which version of java the jar file I have is available
What you need to do to open a file from the menu in the document-Based App macOS app