I know this question has been asked many and many times, but I have done my research and my simple test program still will not run on double click.
When I run the program from the jar (java -jar Test.jar) it will run fine, just double click fails.
I have made a simple class in Eclipse on 64bit Windows 7 Pro, JRE 7 is used and made a Jar file (have tried Runnable)
public class Test {
public static void main(String[] args){
System.out.println("nope");
}
}
Image of basic setup

Here is what I have tried (that I remember):
Checked Manifest and made sure class is spelled right and added two extra spaces to end of main class line
Class is included in the jar
Tried Runnable Jar as well as normal Jar
On Normal Jar I included the Main Class Option and selected the class
Checked ftype and typing java in cmd to see if options come up
I have tried other options, but I can't remember them yet.
Sounds like a file association problem to me: you need to make sure Windows is set up to associate .jar files with java.exe in the right way.
See the answers to: Running JAR file on Windows
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