开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜