How to run a JAR file

前端 未结 11 2171
长发绾君心
长发绾君心 2020-11-22 04:18

I created a JAR file like this:

jar cf Predit.jar *.*

I ran this JAR file by double clicking on it (it didn\'t work). So I ran it from the

11条回答
  •  被撕碎了的回忆
    2020-11-22 04:59

    If you don`t want to create a manifest just to run the jar file, you can reference the main-class directly from the command line when you run the jar file.

    java -jar Predit.jar -classpath your.package.name.Test
    

    This sets the which main-class to run in the jar file.

提交回复
热议问题