1
我試圖加載的.ods與代碼文件:哪些依賴於使用APACHE ODF工具包(孵化)
import org.odftoolkit.simple.SpreadsheetDocument;
SpreadsheetDocument data = SpreadsheetDocument.loadDocument(f);
我已經添加了import語句,以顯示我使用的包。
但是我不斷收到java.lang.NoClassDefFoundError。我試過添加許多不同的庫。目前,我有這些庫在我的Eclipse構建路徑:libraries in my eclipse build path
和我得到這個錯誤
Exception in thread "main" java.lang.NoClassDefFoundError: com/hp/hpl/jena/rdf/model/RDFNode
at org.odftoolkit.odfdom.pkg.OdfFileDom.initialize(OdfFileDom.java:215)
at org.odftoolkit.odfdom.pkg.manifest.OdfManifestDom.initialize(OdfManifestDom.java:74)
at org.odftoolkit.odfdom.pkg.OdfFileDom.<init>(OdfFileDom.java:132)
at org.odftoolkit.odfdom.pkg.manifest.OdfManifestDom.<init>(OdfManifestDom.java:63)
at org.odftoolkit.odfdom.pkg.OdfFileDom.newFileDom(OdfFileDom.java:189)
at org.odftoolkit.odfdom.pkg.OdfPackage.parseManifest(OdfPackage.java:1187)
at org.odftoolkit.odfdom.pkg.OdfPackage.readZip(OdfPackage.java:454)
at org.odftoolkit.odfdom.pkg.OdfPackage.initializeZip(OdfPackage.java:425)
at org.odftoolkit.odfdom.pkg.OdfPackage.<init>(OdfPackage.java:256)
at org.odftoolkit.odfdom.pkg.OdfPackage.loadPackage(OdfPackage.java:318)
at org.odftoolkit.simple.Document.loadDocument(Document.java:319)
at org.odftoolkit.simple.SpreadsheetDocument.loadDocument(SpreadsheetDocument.java:203)
at FirstLoadComponent.main(FirstLoadComponent.java:11)
Caused by: java.lang.ClassNotFoundException: com.hp.hpl.jena.rdf.model.RDFNode
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 13 more
如何把我的代碼運行的任何建議或任何其他我做簡單的讀取和寫入.ods文件將會被大大改變。