Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running JAR file on Windows 10 [duplicate]

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?

like image 694
Asnira Avatar asked Oct 11 '16 07:10

Asnira


People also ask

How do I run a .JAR file by double click?

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.


1 Answers

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.
like image 142
Lawrence Armour Avatar answered Sep 21 '22 03:09

Lawrence Armour