Can you tell me a way to execute process from Java irrespective of underlying operating system? E.G.
Process p = Runtime.getRuntime().exec("cmd /c mvn clean install");
Above line executes Maven in Windows environment but how can I run above command in any operating system?
If I don’t add "cmd/c"
in starting then I am not able to run in windows environment and the error says cannot find mvn.bat
although maven home is set properly.