1

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

jzd
  • 23,473
  • 9
  • 54
  • 76
Sidharth
  • 11
  • 1

1 Answers1

5

Its a resource not a physical file.

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

Community
  • 1
  • 1
jmj
  • 237,923
  • 42
  • 401
  • 438