开发者

apache poi 3.6: Reading an xlsx file

I have a relatively dumb newb question, Im trying to open an xlsx file for reading using the apache POI 3.6.

XSSFWorkbook workBook = 开发者_StackOverflow中文版new XSSFWorkbook("C:\test.xlsx");

The xlsx file was saved in excel 2007, the error Im seeing is: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlException

  • I dont know what the solution is... any ideas and/or example code?


Your classpath is missing one of the dependencies for Apache POI. Specifically, you are missing the XMLBeans jar. Are you using Maven?


and you can download it from here: http://apache.securedservers.com/xmlbeans/binaries/xmlbeans-2.5.0.zip

if (most ppbly) you're using an IDE (eclipse etc) add it in the build path...

if invoking from the CLI use the -cp switch as you might be doing for everything else...

rgds

-ksm

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜