Runtime calls cmd / cd commands
Runtime run = Runtime.getRuntime(); String command = "cmd /c cd /d C:/workspace/TestApp && mvn clean install -Dmaven.test.skip"; // use && to link two dos command; also we can define a bat file, then calling this file via cmd BufferedReader br = new BufferedReader(new InputStreamReader(run.exec(command).getInputStream(), "UTF-8")); String str = ""; while((str = br.readLine()) != null) System.out.println(str); br.close();