我有一个类,它的方法只有在我从命令行运行时才能找到。不过,当我在 JSP 文件中调用它时,似乎什么也没发生。我可以在这里遗漏一些东西吗?是否需要进行一些配置更改才能使此代码正常工作。
public static void toText(String pdfFile, String textFile) {
try {
String[] cmd = {"pdftotext", pdfFile, "/tmp/text1984.txt"};
Process p = Runtime.getRuntime().exec(cmd);
p.waitFor();
} catch (Exception e) {
System.out.print(e.getMessage());
}
}
问候, 菲里