+ 1

How to execute a file with a Java code?

Hello! You all know that when we need to open a file, we just double click it, and the file is exevuted. So i'd like to know how can i do the same through a Java code.

29th Jun 2017, 2:35 AM
Silas Junior
Silas Junior - avatar
1 Answer
+ 1
look up the documentation for ProcessBuilder. I think it goes like new ProcessBuilder ("/fully/qualified/path/to.exe", "arg1", "arg2", ....).start();
29th Jun 2017, 6:17 AM
Venkatesh Pitta
Venkatesh Pitta - avatar