java - I'm trying to read from a word file .. I don't know which jar file I missed : -
I am trying to read a word file. But in reality there is a problem that "type org.apache" .xmlbeans.XmlException can not be solved. This is indirectly expected. Class files are referred to ".. then can i know the problem ??
import org.apache.poi.xwpf.extractor.XWPFWordExtractor; import java.io.file; Import java.io.FileInputStream; import java.io.IOException; Import java.io.InputStream; Import java.io * *; Import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.xwpf .usermodel.XWPF document; public class Read_File {public static zero main (string [] args) {try {fileInputStream fis = new FileInputStream ("C: \\ user \\ desktop \\ m.docx"); Org.apache Poi.xwpf.extractor.XWPFWordExtractor oleTextExtractor = New XWPFWordExtractor (new XWPFDocument (FIS); System.out.print (oleTextExtractor.getText ());} Hold (Exception E) {e.printStackTrace ();}}}}
I have already encountered the problem. Adding Xmlbeans-2.3.0.jar can fix this problem. P>
Comments
Post a Comment