Problem of Developer's Guide Examples "OOoBeanViewer"
I want to see if i can embed Libreoffice in a Java Application. And i tried with the “Developer’s Guide Examples” on link
http://api.libreoffice.org/examples/DevelopersGuide/OfficeBean/OOoBeanVi....
After i installing Libreoffice & SDK with version 4.2.5 and finish the code(uploaded libre_OOoBeanViewer.zip), the demo UI can show normally, but if i click “new document” and select any item, Exception throws as.
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no officebean in java.library.path
For this Exception, i guess it might cause “libofficebean.so” file which in “/opt/libreoffice/program” was not involved in current property “java.library.path”. I tried with the folloing code to update system property.
String property = System.getProperty("java.library.path");
System.setProperty("java.library.path", property + ":/opt/libreoffice4.2/program");
System.out.println("java.library.path=" + System.getProperty("java.library.path"));
But it’s no use. Please refer the attached “6.jpg”.
And if you try “new document”, another Exception throws as follow
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class com.sun.star.comp.beans.LocalOfficeConnection
at com.sun.star.comp.beans.OOoBean.getOOoConnection(OOoBean.java:269)
at com.sun.star.comp.beans.OOoBean.getMultiServiceFactory(OOoBean.java:289)
at com.sun.star.comp.beans.OOoBean.loadFromURL(OOoBean.java:557)
at com.test.oobean.OOoBeanViewer.createBlankDoc(OOoBeanViewer.java:322)
at com.test.oobean.OOoBeanViewer.access$1(OOoBeanViewer.java:313)
at com.test.oobean.OOoBeanViewer$5.actionPerformed(OOoBeanViewer.java:168)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
Does anybody can help me solve this problem? Any suggestion & help is greatly appreciated.
Thanks
William
Attachment | Size |
---|---|
libre_OOoBeanViewer.zip | 1.42 MB |
6.jpg | 319.29 KB |