I have a Java code to convert doc,docx to pdf using document4j it work fine on windows, but in linux I have this problem. Can I use this library on linux? Whats alternatives can I have?
The error is
java.io.IOException: Cannot run program "cmd" (in directory "/tmp/1542047549404-0"): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) ~[na:1.8.0_171]
2018-11-12 18:32:29.508 ERROR 10831 --- [pool-1-thread-1] c.d.c.msoffice.MicrosoftWordBridge : Unable to run script: /tmp/1542047549404-0/word_start184242440.vbs
java.io.IOException: Could not execute [cmd, /S, /C, ""/tmp/1542047549404-0/word_start184242440.vbs""] in /tmp/1542047549404-0.
at org.zeroturnaround.exec.ProcessExecutor.invokeStart(ProcessExecutor.java:936) ~[zt-exec-1.8.jar!/:na]
I think there are several reasons listed on their homepage why conversion cannot work under linux:
[...] the LocalConverter can only be run if:
For alternative approaches see How to convert MS doc to pdf
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.