Run program.exe from eclipse plugin project

前端 未结 2 1736
悲哀的现实
悲哀的现实 2021-01-28 13:00

I am writing an eclipse-plugin witch run program.exe. I have added program.exe to plugin jar file. How can a execute this program?

public class Handler extends A         


        
2条回答
  •  星月不相逢
    2021-01-28 13:47

    You should just execute the program like you would in cmd, but now specify the whole path of the programs location.

    Runtime.getRuntime().exec("C:\\your\\path\\program.exe");
    

    In the Oracle documentation of the Runtime class you can see the acceptable inputs in exec().

提交回复
热议问题