当我试图实现以下任何代码时
File someFile = new File("D:\\arz.doc");
InputStream inputStrm = new FileInputStream(someFile);
HWPFDocument wordDoc = new HWPFDocument(inputStrm);
System.out.println(wordDoc.getText());
或者:
POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream("D:\\arz.doc"));
WordExtractor extractor = new WordExtractor(fs);
String wordText = extractor.getText();
,错误信息总是如下所示:
Exception in thread “main” java.lang.NoSuchMethodError:
org.apache.poi.poifs.filesystem.POIFSFileSystem.getRoot()Lorg/apache/poi/poifs/filesystem/DirectoryNode;
at org.apache.poi.hwpf.HWPFDocument.(HWPFDocument.java:186)
at DB_connect.dissertation_araalz.ParseWodDocFile.main(ParseWodDocFile.java:29)
Java Result: 1
BUILD SUCCESSFUL (total time: 3 seconds)
你能帮我解决这个问题吗?