Sidharth
Sidharth

Reputation: 11

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

Upvotes: 1

Views: 310

Answers (1)

Jigar Joshi
Jigar Joshi

Reputation: 240898

Its a resource not a physical file.

You need to extract it somewhere and then execute it with full path

Upvotes: 5

Related Questions