This is my first post on this forum, so try not to be too sharp on me...
I am trying to implement an application using OfficeBean under linux. Currently I'm using a Slackware box, with a standard installation of OpenOffice3.0.1. The OpenOffice SDK is installed too, under the standard path.
My problem is that everytime I call aBean.aquireSystemWindow(), it raises a strange exception:
Code: Select all
java.lang.Exception:
java.io.IOException: UNO_PATH environment variable is not set (required system path to the office program directory)
java.io.IOException: UNO_PATH environment variable is not set (required system path to the office program directory)
at com.sun.star.comp.beans.LocalOfficeConnection$OfficeService.startupService(LocalOfficeConnection.java:774)
at com.sun.star.comp.beans.LocalOfficeConnection.connect(LocalOfficeConnection.java:336)
at com.sun.star.comp.beans.LocalOfficeConnection.getComponentContext(LocalOfficeConnection.java:240)
at com.sun.star.comp.beans.OOoBean.setOOoConnection(OOoBean.java:183)
at com.sun.star.comp.beans.OOoBean.getOOoConnection(OOoBean.java:283)
at com.sun.star.comp.beans.OOoBean.getMultiServiceFactory(OOoBean.java:303)
at com.sun.star.comp.beans.OOoBean.loadFromURL(OOoBean.java:573)
at openofficeintegration.OpenOfficeIntegrationView.jMenuItem1ActionPerformed(OpenOfficeIntegrationView.java:227)
at openofficeintegration.OpenOfficeIntegrationView.access$900(OpenOfficeIntegrationView.java:28)
at openofficeintegration.OpenOfficeIntegrationView$5.actionPerformed(OpenOfficeIntegrationView.java:150)
--- end.Code: Select all
echo $UNO_PATH
/opt/openoffice.org3/programThe code in question is:
Code: Select all
System.out.println("binding open office");
OOoBean aBean = new OOoBean();
mainPanel.add(aBean);
aBean.setVisible(true);
// attempt to create a new document
String url = "/tmp/doc1.odt";
try{
aBean.loadFromURL(url, null);
aBean.aquireSystemWindow();
} catch (SystemWindowException e) {
//System.out.println(e.toString());
System.out.println("Exceptie SystemWindow");
} catch (NoConnectionException e) {
System.out.println("Exceptie NoConnection");
} catch (Exception e) {
System.out.println("Exceptie generica");
}Thanks in advance and have a nice day.