Accessing an .exe file within a .jar file

0

Good!

I'm new to Java and I'm developing a program that I need to include in a driver's executable. When running the .jar file, how can I make it run the .exe file? Do I have to extract it and then run or can I run it internally?

Thank you!

    
asked by anonymous 30.11.2016 / 13:30

1 answer

0

If I understood right what you asked, do you want to run a jar that runs an executable? If so, you can use the Runtime.exec () method. For example,

Runtime.getRuntime().exec("ping www.google.com");

If you are interested in return status or input / output stream, I recommend using ProcessBuilder.

    
03.12.2016 / 00:54