1

我正在尝试在 CentOS 6.2 服务器上设置 jodconverter-beta-4,但经过几天的尝试,我无法超越我目前所处的位置。我不是 *nix 的巫师,所以如果我犯了一些新手错误,请多多包涵。

我使用添加/删除软件为 OpenOffice.org 安装的组件是:

  • 核心品牌
  • 核心模块
  • 计算,绘图,印象,数学,作家
  • 电子表格、绘图、演示文稿、方程式、文字处理器库
  • 额外的图形过滤器
  • UNO

我在 /opt/ 中创建了一个符号链接

ln -s /usr/lib64/openoffice.org3/ openoffice.org3

当我执行时:

java -jar jodconverter-core-3.0-beta-4.jar test.docx test.pdf

我得到以下信息:

    Jun 12, 2012 10:56:40 a.m. org.artofsolving.jodconverter.office.ProcessPoolOfficeManager <init>
INFO: ProcessManager implementation is LinuxProcessManager
Exception in thread "main" org.artofsolving.jodconverter.office.OfficeException: failed to start and connect
   at org.artofsolving.jodconverter.office.ManagedOfficeProcess.startAndWait(ManagedOfficeProcess.java:64)
   at org.artofsolving.jodconverter.office.PooledOfficeManager.start(PooledOfficeManager.java:101)
   at org.artofsolving.jodconverter.office.ProcessPoolOfficeManager.start(ProcessPoolOfficeManager.java:62)
   at org.artofsolving.jodconverter.cli.Convert.main(Convert.java:112)
Caused by: java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: method java.util.regex.Pattern.quote with signature (Ljava.lang.String;)Ljava.lang.String; was not found.
   at java.util.concurrent.FutureTask$Sync.innerGet(libgcj.so.10)
   at java.util.concurrent.FutureTask.get(libgcj.so.10)
   at org.artofsolving.jodconverter.office.ManagedOfficeProcess.startAndWait(ManagedOfficeProcess.java:62)
   ...3 more
Caused by: java.lang.NoSuchMethodError: method java.util.regex.Pattern.quote with signature (Ljava.lang.String;)Ljava.lang.String; was not found.
   at org.artofsolving.jodconverter.process.LinuxProcessManager.findPid(LinuxProcessManager.java:51)
   at org.artofsolving.jodconverter.office.OfficeProcess.start(OfficeProcess.java:65)
   at org.artofsolving.jodconverter.office.OfficeProcess.start(OfficeProcess.java:60)
   at org.artofsolving.jodconverter.office.ManagedOfficeProcess.doStartProcessAndConnect(ManagedOfficeProcess.java:119)
   at org.artofsolving.jodconverter.office.ManagedOfficeProcess.access$000(ManagedOfficeProcess.java:31)
   at org.artofsolving.jodconverter.office.ManagedOfficeProcess$1.run(ManagedOfficeProcess.java:58)
   at java.util.concurrent.Executors$RunnableAdapter.call(libgcj.so.10)
   at java.util.concurrent.FutureTask$Sync.innerRun(libgcj.so.10)
   at java.util.concurrent.FutureTask.run(libgcj.so.10)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(libgcj.so.10)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(libgcj.so.10)
   at java.lang.Thread.run(libgcj.so.10)

提前致谢!

4

1 回答 1

0

我安装了 Java GCJ,它导致了同样的错误。即,确保您安装了正确版本的 JAVA(我假设您需要 OpenJDK 运行时环境)。

找到您想要的包yum search java和/或yum provides java. 就我而言,它是java-1.7.0-openjdk.x86_64,然后:

yum install java-1.7.0-openjdk.x86_64

不要忘记删除以前的版本 ( yum remove)

于 2012-12-14T14:44:10.527 回答