Launch4J - how to attach dependent jars to generated exe

前端 未结 7 910
深忆病人
深忆病人 2020-11-28 13:43

I have a simple java project, which requires external jars. I build this with netbeans and after Clean and Build command, I can find in dist directory the following structur

相关标签:
7条回答
  • 2020-11-28 14:39

    I also faced the same issue while migrating my .jar to exe. I also had many dependent libraries as well. So These were the steps I performed :

    1. Download and Install launch4j.

    2. Open your project in netbeans. Clean and build the project.

    3. Make sure you have a folder named 'dist' in the project directory. It will have your jar files with lib folder(containing the dependent libraries).
    4. Open launch 4j.
    5. Create output file in the dist folder. For example : OutputFile : D:******\My_App\dist\my_application.exe
    6. Browse your jar file in the next row. For example : Jar : D:******\My_App\dist\my_application.jar
    7. Go to classpath tab. Tick CustomClasspath. Press browse icon, and browse to your jar file which is located in the dist folder.
    8. Specify Min Jre version in the JRE tab.
    9. Save the configration.
    10. Build the wrapper(by clicking the settings icon)
    11. Your exe file will be generated in the dist folder. Thats it :)
    0 讨论(0)
提交回复
热议问题