我想要做的是將補丁應用到我的軟件。 要應用修補程序,我必須運行一個批處理文件,它將替換應用程序jar文件。如何使用ProcessBuilder作爲子進程啓動批處理文件?
我將開始從正在運行的應用程序中應用修補程序。
我有一個批處理文件從Java運行。我正在使用流程構建器來運行批處理文件。
在批處理文件中,我關閉已調用使用
taskkill /f /t /im myjavaprogram.exe
當執行此命令時,我得到以下輸出
01/09/2014 13:15:25 : Starting to apply patch.
ERROR: The process with PID 3652 (child process of PID 3564) could not be terminated.
Reason: The process cannot terminate itself.
SUCCESS: The process with PID 3564 (child process of PID 5648) has been terminated.
SUCCESS: The process with PID 5648 (child process of PID 3624) has been terminated.
的批處理文件批處理文件中的Java應用程序由java程序啓動的子進程作爲子進程啓動。
如何開始將批處理文件進程作爲explorer.exe的獨立進程或子進程啓動?
這是不可能的。我認爲你應該從高層次角度編輯問題,詢問你想要什麼,因爲人們會建議替代方案。 – aalku