且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从JAR内部运行* .exe文件

更新时间:2023-09-29 22:54:10

将文件复制到临时位置并运行它是可行的方法。您链接到的答案会做更多必要的工作,因为您可以将您的exe文件作为InputStream并将其复制到具有Apache Commons IO FileUtils.copy(in,out)等实用程序的文件中/ code>

Copying the file to a temporary location and running it is the way to go. The answer you linked to does much more work that necessary, as you can get your exe file as an InputStream and copy it to a file with a utility like Apache Commons IO FileUtils.copy(in, out)

参见如何将jar中的文本文件复制到jar外的文件中?例如。