2017-02-12

6: To Build the Environment for Developing UNO Extensions (LibreOffice Extensions or Apache OpenOffice Extensions), for Windows

<The previous article in this series | The table of contents of this series | The next article in this series>

Main body START

To Know How to Handle (Read or Write) LibreOffice or Apache OpenOffice Writer or Calc Documents via Extensions from Java or Macro Programs

To Build the Environment for Developing UNO Extensions, for Windows

-Hypothesizer

As we have built the environment for developing UNO extensions on Linux, now, we will build the environment for developing UNO extensions on Windows.

-Rebutter

All right.

-Hypothesizer

First, LibreOffice will be installed. . . . The package file can be downloaded from the LibreOffice download Web page. We can begin the installation using the package file.

-Rebutter

OK.

-Hypothesizer

After the installation is finished, the program directory of LibreOffice (here, D:\LibreOffice\program, as LibreOffice has been installed to D:\LibreOffice) will be added to the OS command path.

-Rebutter

Is that necessary? I mean, the OS command path doesn't need to be set for LibreOffice to work.

-Hypothesizer

Yes, it's necessary for LibreOffice SDK tools to work properly: LibreOffice SDK tools look up LibreOffice dlls in the OS command path.

-Rebutter

Oh, I understand.

-Hypothesizer

That can be done by the following procedures, as of October 2016 (these procedures may be changed in the future as user interfaces of Windows 10 are changed sometimes). . . . To set it system-wide (Administrator right will be required), right click the start button; click 'Control Panel'; click 'System'; click 'Advanced system settings'; click 'Environment Variables'; in the 'System variables' section, edit the variable, Path, to include the program directory of LibreOffice; click 'OK's to confirm the setting. . . . To set it only for the current logged in user, right click the start button; click 'Control Panel'; click 'User Account'; click 'Change my environment variables'; in the 'User variables' section, edit or add the variable, Path, to include the program directory of LibreOffice; click 'OK's to confirm the settings.

-Rebutter

Just out of curiosity, how can we install Apache OpenOffice?

-Hypothesizer

The packages of Apache OpenOffice and its SDK can be downloaded from the Apache OpenOffice download Web page, and we can install them using the packages.

-Rebutter

I see.

-Hypothesizer

Second, LibreOffice SDK will be installed. . . . The package file can be downloaded from the LibreOffice download Web page. We can begin the installation using the package file.

-Rebutter

OK.

-Hypothesizer

Third, Oracle JDK will be installed. . . . The package file can be downloaded from the Oracle JDK download Web page. We can begin the installation using the package file.

-Rebutter

OK.

-Hypothesizer

After the installation is finished, the JDK binary directory will be added to the OS command path, and a necessary environment variable will be set. That can be done by the following procedures, as of October 2016 (these procedures may be changed in the future as user interfaces of Windows 10 are changed sometimes). . . . To set them system-wide (Administrator right will be required), right click the start button; click 'Control Panel'; click 'System'; click 'Advanced system settings'; click 'Environment Variables'; in the 'System variables' section, add the variable, JAVA_HOME, with the value of the directory of the JDK; in the 'System variables' section, edit the variable, Path, to include %JAVA_HOME%\bin; click 'OK's to confirm the settings. . . . To set them only for the current logged in user, right click the start button; click 'Control Panel'; click 'User Account'; click 'Change my environment variables'; in the 'User variables' section, add the variable, JAVA_HOME, with the value of the directory of the JDK; in the 'User variables' section, edit or add the variable, Path, to include %JAVA_HOME%\bin; click 'OK's to confirm the settings. . . . When a new terminal is opened, the setting should be reflected in the environment of the terminal.

-Rebutter

I see.

-Hypothesizer

Forth, Ant will be installed. If we don't use Ant, this isn't necessary. . . . Ant can be downloaded from the Ant download Web page. Here, the binary only distribution zip file is downloaded. We create an arbitrary directory (here, D:\Ant), and expand the downloaded zip file there.

-Rebutter

All right.

-Hypothesizer

Then, the Ant binary directory will be added to the OS command path, and a necessary environment variable will be set. Here, the OS command path and the environment variable will be set only for the current logged in user. That can be done by the following procedure, as of October 2016 (this procedure may be changed in the future as user interfaces of Windows 10 are changed sometimes). Or we can set them in whatever other way. . . . To set them, right click the start button; click 'Control Panel'; click 'User Account'; click 'Change my environment variables'; in the 'User variables' section, add the variable, ANT_HOME, with the value of the directory of the Ant (here, D:\Ant\apache-ant-1.9.6); in the 'User variables' section, edit or add the variable, Path, to include %ANT_HOME%\bin; click 'OK's to confirm the settings. . . . When a new terminal is opened, the setting should be reflected in the environment of the terminal.

-Rebutter

I see.

-Hypothesizer

Fifth, Gradle will be installed. If we don't use Gradle, this isn't necessary. . . .Gradle can be downloaded from the Gradle download Web page. Here, the binary only distribution is downloaded. We create an arbitrary directory (here, D:\Gradle), and expand the downloaded zip file there.

-Rebutter

OK.

-Hypothesizer

Then, the Gradle binary directory will be added to the OS command path, and a necessary environment variable will be set. Here, the OS command path and the environment variable will be set only for the current logged in user. That can be done by the following procedure, as of October 2016 (this procedure may be changed in the future as user interfaces of Windows 10 are changed sometimes). Or we can set them in whatever other way. . . . To set them, right click the start button; click 'Control Panel'; click 'User Account'; click 'Change my environment variables'; in the 'User variables' section, add the variable, GRADLE_HOME, with the value of the directory of Gradle (here, D:\Gradle\gradle-3.1); in the 'User variables' section, edit or add the variable, Path, to include %GRADLE_HOME%\bin; click 'OK's to confirm the settings. . . . When a new terminal is opened, the setting should be reflected in the environment of the terminal.

-Rebutter

OK.

-Hypothesizer

Sixth, the Java runtime to be used by LibreOffice will be set. . . . We can set it like this: run LibreOffice Calc; click 'Tools' on the menu; click 'Options'; click 'Advanced'; check 'Use a Java runtime environment'; select the public JRE or the JDK private JRE; click 'OK'.

-Rebutter

What are JDK private JREs and public JREs?

-Hypothesizer

The JDK private JRE is the JRE included inside the installed JDK, being installed along with the JDK. The Public JRE is a JRE installed outside any JDKs (the JDK installer can optionally install a public JRE, but anyway, that JRE is outside the JDK).

-Rebutter

Hmm . . .

-Hypothesizer

Now, the environment for developing UNO extensions has been built for Windows.

Main body END

References

  • The Document Foundation. (n/a). LibreOffice Fresh. Retrieved from https://www.libreoffice.org/download/libreoffice-fresh/
  • The Apache Software Foundation. (n/a). Apache OpenOffice - Downloads. Retrieved from http://openoffice.apache.org/downloads.html
  • Oracle. (n/a). Java SE Downloads. Retrieved from http://www.oracle.com/technetwork/java/javase/downloads/index.html
  • The Apache Software Foundation. (n/a). Binary Distributions. Retrieved from http://ant.apache.org/bindownload.cgi
  • Gradle Inc. (n/a). Download Gradle 3.1. Retrieved from https://gradle.org/gradle-download/

<The previous article in this series | The table of contents of this series | The next article in this series>