Running JAR file on Windows

前端 未结 25 2166
故里飘歌
故里飘歌 2020-11-22 01:57

I have a JAR file named helloworld.jar. In order to run it, I\'m executing the following command in a command-line window:



        
25条回答
  •  遇见更好的自我
    2020-11-22 02:26

    You want to check a couple of things; if this is your own jar file, make sure you have defined a Main-class in the manifest. Since we know you can run it from the command line, the other thing to do is create a windows shortcut, and modify the properties (you'll have to look around, I don't have a Windows machine to look at) so that the command it executes on open is the java -jar command you mentioned.

    The other thing: if something isn't confused, it should work anyway; check and make sure you have java associated with the .jar extension.

提交回复
热议问题