Conversion of .class to jar and .class to exe

后端 未结 5 966
星月不相逢
星月不相逢 2021-02-03 12:13

How do I convert:

  • class file to jar file using cmd?
  • class file to exe file?
  • jar file to exe?

Can I convert exe file to jar file?

5条回答
  •  日久生厌
    2021-02-03 12:44

    If you are using Netbeans IDE, then creating .exe file from .class file won't take much time. In IDE, create a new project and put your java program in this project. Now follow these steps-

    1. Right click the project and choose properties.
    2. Choose run from left panel and enter the main class(in which main method is defined) in right panel.
    3. Again right click the project and choose add library. Select swing layout extensions. Click add library. 4.Now select clean and build from run menu in your IDE. Make sure that you have already set your this project as main project.
    4. Open the CMD and set the directory to your project. Go to "dist" > and type java -jar jarname.jar.
    5. Your program is running in cmd now.
    6. Open launch4j and provide the information required.
    7. Run and enjoy your application.

提交回复
热议问题