Reputation: 11
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
Upvotes: 1
Views: 310
Reputation: 240898
Its a resource not a physical file.
You need to extract it somewhere and then execute it with full path
Upvotes: 5