The move from OpenOffice To LibreOffice For Java Developers

After Sun Inc had been acquired by Oracle ; and because of some clashes between Sun’s open source projects communities and the -somewhat unfriendly- Oracle attitude towards Sun’s open source projects; OpenOffice has been forked to LibreOffice. This Effort is being Led by document foundation probably with joint efforts to come from major Linux companies Like Novel ,Ubuntu and RedHat .

For Java OpenOffice API developers , the move to Libreoffice should be straightforward. the basic idea is just replace OpenOffice installation and sdk with corresponding Libreoffice ones. If you consider doing serious Java Libreoffice extension development it is advised to use an IDE plugin for Libreoffice.

The only two available Libreoffice/openoffice java IDE plugins are OOEclipseIntegration and Netbeans 6.8 API Plugin . While the eclipse OO plugin is available in eclipse marketplace repos from eclipse IDE (3.6+) and is still undergoing active development; It seems the netbeans OO plugin doesn’t get upgraded into higher netbeans versions anymore. So you are stuck using the old netbeans version 6.8.

To set up your Netbeans development environment with Libreoffice do the following steps:

  1.   Get netbeans IDE 6.8 and then install plugin “ API Plugin” from netbeans IDE plugins dialog.
  2.   Downlaod and Install Libreoffice and Libreoffice SDK.
  3. In Netbeans IDE select “Tools->Options->Miscellaneous”. select Tab “OOo API Plugin”. then in fields “ installation” and “ SDK installation” browse to the folder where you installed Libreoffice and libreoffice SDK respectively as described in image below:

When you create a new Project for API the currently specified Libreoffice sdk library will be automatically added to your Netbeans OpenOffice Project classpath (for example Libreoffice 3.4 library )

For a Detailed tutorial on java netbeans OpenOffice API development refer to Kay Kroll on Netbeans OpenOffice integration .  I have also included a presentation by jurgen Shmidt included in the ‘Additional Resources’ section at the bottom of this post. These two tutorials although for they also apply to Libreoffice java development in Netbeans as the same process applies for both OpenOffice and LibreOffice.


For people using linux (specifically opensuse 12.+) upgrading to Libreoffice version 3.5+ causes some issues. In  netbeans 6.8 IDE the automatically added  library ‘LibreOffice 3.5 or 3.6’ to the project classpath  misses other important jars for some unknown reasons. I had to manually add the following jars from the directory ‘Your_LO_Home/ure/share/java’ :


For some unkown reason the netbeans library LibreOffice 3.5 doesn’t contains these jars and i had to add them manually to project classpath.

Another issue with netbeans OO plugin and LO sdk 3.5+ is when you clean and build your OO project and try ‘debug extension in OO Target’ there is a wiered error massage stating:

‘user doesn’t have write permission to install this extension’.

you simply overcome this error message by running again the ‘debug extension in OO Target’.

Additional Resources: