Running JAR file on Windows

前端 未结 25 2149
故里飘歌
故里飘歌 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:44

    If you need to run the jar file by double clicking on it, you have to create it as a "Runnable JAR". you can do it simply with your IDE.

    If you're using eclipse, follow these steps :

        To create a new runnable JAR file in the workbench:
    
    1.From the menu bar's File menu, select Export.
    2.Expand the Java node and select Runnable JAR file. Click Next.
    3.In the  Opens the Runnable JAR export wizard Runnable JAR File Specification page, select a 'Java Application' launch configuration to use to create a runnable JAR.
    4.In the Export destination field, either type or click Browse to select a location for the JAR file.
    5.Select an appropriate library handling strategy.
    Optionally, you can also create an ANT script to quickly regenerate a previously created runnable JAR file.
    

    more information can be found on Eclipse help Page: LINK

提交回复
热议问题