including an exe file to jar

前端 未结 1 1589
时光说笑
时光说笑 2020-12-17 05:20

I have written a java program that is actually works as a gui to an existing command line program. so in basic all my program does is Runtime.getRuntime().exec(\"mypro

相关标签:
1条回答
  • 2020-12-17 06:00

    You can simply jar it up as an extra resource (like a .css, .properties etc.).

    When your Java program runs, extract the .exe using Class.getResourceAsStream() and write it to a temporary directory in order to run it from there (since you can't run it directly from the .jar file).

    0 讨论(0)
提交回复
热议问题