Unable to invoke a .exe file inside an executable Jar. How to?
I wanted to invoke a .exe file wrapped inside an executable Jar file. Following is the main class which is supposed to invoke the .exe file.
import java.io.File;
public class TriggerApp{
public static void main(String[] args)
{
try
{
Runtime rt=Runtime.getRuntime();
rt.exec("MoreComplexUI.exe");
}
catch(Throwable t)
{
System.out.开发者_运维知识库print(t.getMessage());
}
}
}
It does not work. This Jar file contains other supporting files to run the .exe
Its a resource not a physical file.
You need to extract it somewhere and then execute it with full path
精彩评论