I put pandoc on a Windows network drive. The following call succeeds in the command line:
P:\Maven\pandoc\pandoc-1.19.2.1-windows\pandoc.exe -t markdown C:\devel\ContiMars2\workspace\compareABM\docs\release-notes-utf8.html
but when starting it from Java using ProcessBuilder,
List<String> command = new ArrayList<>();
command.add("P:\\Maven\\pandoc\\pandoc-1.19.2.1-windows\\pandoc.exe");
command.add("-t markdown");
command.add("C:\devel\ContiMars2\workspace\compareABM\docs\release-notes-utf8.html");
ProcessBuilder pb = new ProcessBuilder(command);
I get:
pandoc.exe: Unknown writer: markdown
Any idea why?
This is just the usual problem with spaces in commands that are given to ProcessBuilder
. If you write --to=markdown
instead of -t markdown
, everything is fine.