The LibreOffice 24.2 SDK comes with a set of development tools, base libraries, header files and helper class files that can be used to develop Java/C++ components, to embed the LibreOffice 24.2 application in your own programs, or to use the API (scripting or remote control the office). For a complete working environment, we have some additional requirements:
The SDK works on top of an existing LibreOffice installation and uses the same libraries as the LibreOffice installation.
Download the SDK from the same source as your LibreOffice packages.
Note: Do not mix and match The Document Foundation LibreOffice releases with downstream SDK packages or vice versa!
A JDK is necessary for developing Java components or applications. An appropriate Java SDK can be found on http://java.sun.com/products.
Recommendation is to use Java 7 or later for 64bit, and Java 6 for 32bit.
Note: The Java compiler is optional!
Linux | GNU C++ compiler, gcc version 4.1 or later |
macOS | Xcode |
Windows | Microsoft C++ Compiler, Microsoft Visual Studio 2010 or later, or the Express edition thereof |
Note: The C++ compiler is optional! If you use the Express edition you have to ensure that the Microsoft Visual Studio 2008 Redistributable Package is also installed. You can download this package from Microsoft directly.
Note: The .NET Framework is optional!
GNU make is used to build the examples of the SDK. GNU make is available from http://www.gnu.org. It can be ftped via ftp://ftp.gnu.org/gnu/make
Note: Windows user can find an executable of gnu make under http://www.mingw.org/wiki/Getting_Started (see the mingw32-make link under "Manual Installation"). Do not use the Cygwin make, because it does not work well. On Solaris gnu make can be found often under /usr/sfw/bin/gmake, but keep in mind that you have to use 'gmake' then. Or you can find gnu make also under http://www.sunfreeware.com/.
Note for Windows users: If you do not have these already, you can download them from http://sourceforge.net/projects/unxutils/files/latest/download.
The SDK provides a mechanism which configures the SDK build environment to your personal needs the first time you use the SDK environment. This configuration step creates a new setsdkenv_XXX script in the user's home directory:
To start the configure script, change into the SDK root directory and run:
The configure script requests relevant information and directories (SDK, LibreOffice, GNU make, Java, C++), in order to prepare a working SDK environment. (On Unix-like systems, the configure script recursively starts a new interactive shell with the relevant environment variables set; this is not needed on Windows.) After completing the configure script once, the newly created script is always used to set the necessary environment variables for using the SDK and the required tools.
On Unix-like systems, the configure script uses Perl. Linux systems should have installed a working Perl version, and on Solaris you can find a working Perl version under http://www.sunfreeware.com/ if necessary. On Windows, the configure script uses Windows Script and a JScript. If you have problems with Windows Script, you can download a newer version of Windows Script.
If you use the template batch file, edit and set the following variables:
OFFICE_HOME | Path to an existing LibreOffice installation, e.g. "/opt/libreoffice8". |
OO_SDK_NAME | The configuration uses the directory name of the SDK, but you can use another name as well. It is important that the name does not contain spaces, because of a limitation of gnu make which cannot handle spaces correctly. This name is, for example, used to create an output directory in the users home directory for any generated output when you use the SDK build environment. |
OO_SDK_HOME | Path to the SDK root directory, e.g. "/opt/libreoffice/sdk" |
OO_SDK_JAVA_HOME | Path to a JDK root directory. The JDK is optional and only necessary if you like to run the Java examples or if you like to use the SDK environment to develop your own Java solution. |
OO_SDK_CPP_HOME | Path to the C++ compiler (on Windows, the directory where the "vcvar32.bat" file can be found). The C++ compiler is optional and only necessary for building the C++ examples. |
OO_SDK_CLI_HOME | Path to the C# compiler and VB.NET compiler (on Windows, this directory can be found under the system directory (e.g. c:\WINXP\Microsoft.NET\Framework\v1.0.3705). The compilers are optional and only necessary for building the CLI examples. Note: Windows only! |
OO_SDK_MAKE_HOME | Path to GNU make. |
OO_SDK_ZIP_HOME | Path to the 'zip' tool. |
OO_SDK_CAT_HOME | Path to the 'cat' tool. |
OO_SDK_SED_HOME | Path to the 'sed' tool. |
OO_SDK_OUTPUT_DIR | Path to an existing directory where the example output is generated. The output directory is optional, by default the output is generated in the SDK directory itself. If an output directory is specified, the output is generated in an SDK dependent subdirectory in this directory (e.g. /LibreOffice 24.2/LINUXExample.out) |
SDK_AUTO_DEPLOYMENT | If this variable is set, the component examples are automatically deployed into the LibreOffice installation referenced by OFFICE_HOME. See also section "Extension Manager - unopkg" from the Developer's Guide. |
You must run the setsdkenv_XXX script every time you want to use the configured SDK environment. The settings are local for the current shell on Windows or the new started shell on Unix-like systems. On Unix-like systems you can now source the prepared environment script file ("setsdkenv_unix.sh") to prepare your current shell instead of starting a new shell.
If you do not want to use the script to set your working environment, you must set the appropriate environment variables yourself. The script sets the following environment variables:
Common Environment Variables
OO_SDK_NAME | See description above. |
OO_SDK_URE_BIN_DIR | The path within the chosen LibreOffice URE installation where binary executables are located. |
OO_SDK_URE_LIB_DIR | The path within the chosen LibreOffice URE installation where dynamic libraries are located. |
OO_SDK_URE_JAVA_DIR | The path within the chosen LibreOffice URE installation where Java JARs are located. |
CLASSPATH | =$OO_SDK_URE_JAVA_DIR/libreoffice.jar; $OO_SDK_URE_JAVA_DIR/unoloader.jar; $CLASSPATH |
The classpath will be set or extended to the necessary jar files of the specified LibreOffice installation.
This variable is used to find, for example, the office type library and the UNO package deployment tool.
This variable is used to ensure that the new C++ UNO bootstrap mechanism uses the configured LibreOffice installation of the SDK. Normally the bootstrap mechanism finds the default office installation for the user on the system. This variable is optional but is set from the scripts to ensure a homogeneous environment. Especially useful during development where you might have more than one office installation installed.
Environment Variables for Unix-like systems
The LD_LIBRARY_PATH will be set or will be extended by the office/URE library path, the platform dependent lib directory for several additional libraries.
The PATH variable will be extended by the paths for the SDK development tools, the compiler, the JDK, GNU make, the zip tool and the OO_SDK_URE_BIN_DIR, where the compiler or the JDK are optional.
The LD_LIBRARY_PATH will be set or will be extended by the office/URE library path, the platform dependent lib directory for some additional libraries.
The PATH variable will be extended by the paths for the SDK development tools, the compiler, the JDK, GNU make, the zip tool and the OO_SDK_URE_BIN_DIR, where the compiler and the JDK are optional.
Environment Variables for Windows
The PATH variable will be extended by the paths for the SDK development tools, the compiler, the JDK, GNU make, the zip tool and the OO_SDK_URE_BIN_DIR.
The LIB variable will be extended by the path to the import libraries that are necessary for Windows.
Copyright © 2000–2024 LibreOffice contributors. All rights reserved.
LibreOffice was created by The Document Foundation, based on OpenOffice.org.
The Document Foundation acknowledges all community members, please find more info at our website.
Privacy Policy | Impressum (Legal Info) | Copyright information: The source code of LibreOffice is licensed under the Mozilla Public License v2.0 (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.