How to make a runnable jar file?

前端 未结 3 2008
旧时难觅i
旧时难觅i 2020-11-29 12:17

There was a program that I used that made runnable .jar files.. All the ones I\'m finding now are ones that make .exe files.. I remember it also has the option to make the f

相关标签:
3条回答
  • 2020-11-29 12:34

    The command line

    java -jar file.jar
    

    Will run your jar file if it has a Main-Class defined as explained here.

    You can use that command in a shell script.

    0 讨论(0)
  • 2020-11-29 12:35

    Do you mean actually coding java and then compiling to .jar? If you do try eclipse code editor

    I used eclipse to make minecraft mods. It will work if you want to make .jar programs.

    0 讨论(0)
  • 2020-11-29 12:40

    You can create a runnable jar using NetBeans IDE or Eclipse IDE by just proving the Main class to run.Rest of the things it will take automatically.That class must be having a main() method in it.Then you can run that jar file using java -jar yourjarfile.jar

    0 讨论(0)
提交回复
热议问题