My goal is to run SVN commands from java for one of my requirements, for the same i have already installed TortoiseSVN command line tool. Added the appropriate path\"C:/Prog
You need to separate the executable from its arguments:
new ProcessBuilder("svn", "--version")
See the ProcessBuilder constructor JavaDoc for more details and examples.
It's because you're not using ProcessBuilder
correctly. The Javadocs are pretty clear cut.
You can't pass the --version
argument as part of the process name you're trying to invoke; that's not the filename of the process. Behind the scenes you're exec'ing a process directly - there's no shell involved.
ProcessBuilder svnProcessBuilder = new ProcessBuilder("svn", "--version");