I have made a Jar file, but I cant make it to run by double clicking.
It works fine using java -jar name.jar
or by making a batch file.
I have already reinstalled jdk1.8.0_102, set the JAVA_HOME
variable and javaw.exe
in the jre folder is already the default program to run it.
so how do I make it to run by double clicking?
Normally after installing Java, there will be an association between . jar and the javaw.exe. This enables the executable jar to be opened on double click. You can check the association by going to Control Panel -> Programs -> Default Programs -> Associate a file type or protocol with a program.
How do I run an executable JAR file? If you have a jar file called Example.jar, follow these rules:
Open a notepad.exe.
Write : java -jar Example.jar.
Save it with the extension .bat.
Copy it to the directory which has the .jar file.
Double click it to run your .jar file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With