Java Eclipse: Difference between exporting as a JAR and exporting as a Runnable JAR

前端 未结 4 1136
旧巷少年郎
旧巷少年郎 2020-12-12 16:03

What is the difference in eclipse between exporting as a JAR file and exporting as a Runnable JAR file? Aren\'t they both runnable? What are the pros/cons of each?

4条回答
  •  感动是毒
    2020-12-12 16:28

    With the standard JAR file, you have to specify the class with the main method on the command line when running the jar. With a runnable JAR, there is a manifest file that will hold that information so you can just type java -jar myRunnable.jar, or simply double click it.

提交回复
热议问题