简体   繁体   中英

java desktop application not running from executable jar file

I had created one application in java net beans with MySQL connectivity , its running well in net beans but when I created its executable jar file , it does not run form jar icon . How can I make it run from it.

When You build a java project you get a .jar file as output which you can not execute.

To execute this file you will have to make some kind of launcher. This can be done easily with a .bat file on windows

For example I have a .jar file called game.jar

Make a text file write the following code, then save as .bat

java -jar game.jar

Make sure the .bat file is located in the same directory as the .jar file

Extra info: https://docs.oracle.com/javase/tutorial/deployment/jar/run.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM