try using Process! this is how i use it in my application:
Process process = new ProcessBuilder()
.command(convert, image.name, "-thumbnail", "800x600>", bigsize.name)
.directory(image.parentFile)
.redirectErrorStream(true)
.start()
I would suggest you can use like:
Process process = new ProcessBuilder()
.command("winword.exe", "FinalReport.doc")
.directory(new File("C:/"))
.redirectErrorStream(true)
.start()
source
share