Open an . exe file inside a . jar file

Asked

Viewed 50 times

0

Good!

I’m new to Java and I’m developing a program where I need to include it in a driver executable. By running the file . jar, how can I make you run the . exe file? I have to extract it and then run or I can run it internally?

Thank you!

1 answer

0

If I understand correctly 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.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.