Can I run an exe file using a java ?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can I run an exe file using a java ??

I want to run any .exe file on my System using Java, I have experience with C++ and few other programming languages but not Java. Any leads or ideas would be appreciated!

11th May 2017, 9:52 PM
Muti Ur Rehman
Muti Ur Rehman - avatar
4 Answers
+ 4
If you want to run a .exe file from within java i believe you can use this Runtime.getRuntime().exec("yourapp.exe");
11th May 2017, 11:40 PM
Steve
Steve - avatar
+ 3
i believe you need to convert it into a .jar file so that it can be executed
11th May 2017, 9:56 PM
Edward
+ 2
Java's executable files (.class) runs through a VM... wich is part of the JDE. Why would you run .exe files through java anyway?
11th May 2017, 11:24 PM
Steve
Steve - avatar
0
I need to run any pre-existing software on the system. I'm trying to make a GUI and want to start a program say "Calculator" on my windows by the press of button.
11th May 2017, 10:33 PM
Muti Ur Rehman
Muti Ur Rehman - avatar