I made a jar and keep it on my desktop. Then I double clicked on the jar and it works great for me.
Like me and what I have: in my main class, do some operation, and at the end I add to Thread.sleep(25000); to hold the program for a few moments. After each double click on the exported jar, I found a new javaw.exe process in the system process tree . I noticed this in the task manager. and after 25000ms the javaw.exe process is over. Since my application does not integrate any GUI, why didnβt I see any changes in the GUI for the corresponding process. I am sure that if my application has some kind of graphical interface, I will definitely get a corresponding GUI window for each launch.
Common errors: when exporting a project from Eclipse as an executable JAR file, it is exported with the selected Eclipse startup configuration and special Eclipse startup shells. Now, if the configuration does not match, when you try to start it with a double click, you will not be able to see this error. If you run it from CMD, then you will surely get an error log.
To create a standard executable JAR file: to create a standard executable JAR file, you can export as a JAR file and specify the main class on the last screen of the wizard.
This works fine for me. I used the same jar from different systems and saved it in another place.
source share