我有一个类,它有一个方法,当我从命令行运行它时就会找到它。当我在JSP文件中调用它时似乎没有发生任何事情。我能在这里错过什么吗?是否需要对此代码进行一些配置更改。带有JSP的Runtime.getRuntime()。exec(cmd)
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());
}
}
问候, 菲利
#1:网络浏览器与网络服务器在同一台机器上运行 #2:我将通读文章,否则,我发现使用Runtime.getRuntime()。exec(cmd) 谢谢。 – lightonphiri 2011-03-19 18:30:48