Install the correct JRE - LibreOffice on windows 10
This description refers to the version LibreOffice 6.
- Download LibreOffice Beta for Debian (32-bit) for Linux to use feature-rich application for document production and data processing.
- LibreOffice / ˈ l iː b r ə / is a free and open-source office productivity software suite, a project of The Document Foundation (TDF). It was forked in 2010 from OpenOffice.org, which was an open-sourced version of the earlier StarOffice.The LibreOffice suite consists of programs for word processing, creating and editing of spreadsheets, slideshows, diagrams and drawings, working with.
A bit old-fashioned as far as looks are concerned, but quite powerful even in the free version. Opens blazingly fast (in marked contrast to Libre Office, which takes ages). I also use PDF X-Change Lite (also free), from the same publisher, to convert to pdf any printable file created by a Windows program.
Why Java Runtime Environment (JRE)
LibreOffice Base, see also Documentation, uses the HSQL database, this requires Java Runtime Environment (JRE).
It explains how to install the right Java Runtime Environment (JRE) on Windows 10 and how to integrate it into LibreOffice.
Which version JRE
If you use LibreOffice in the 32-bit version, you must also install the JRE 32-bit version.
If you use LibreOffice in the 64-bit version, you must also install the JRE 64-bit version.
Regardless, you can also install the JRE 32-bit and 64-bit versions in parallel.
JRE – Download
The current JRE can be downloaded from the Java website https://www.java.com or from https://www.java.com/en/download/manual.jsp.
Important Oracle Java License Update - The Oracle Java License has changed for releases starting April 16, 2019.
Examples under Windows
Example 32-Bit version JRE
Example of a downloaded JRE file for the 32-bit version on Windows:
This is usually in the 'Download folder' and still needs to be installed.
Example 64-bit version JRE
Example of a downloaded JRE file for the 64-bit version on Windows:
This is usually in the 'Download folder' and still needs to be installed.
Installation of a JRE
Install the desired JRE file as instructed by your operating system.
If you have older JRE installed, you may be asked to delete it.Confirm this.
JRE register in LibreOffice
To register the JRE in LibreOffice, open LibreOffice.
From the menu Tools ▸ Options ▸ LibreOffice ▸ Advanced.
In the 'Options LibreOffice Advanced' dialog, under 'Java Options', check the box 'Use a Java Runtime Environment'.
If there is no entry here, go to Add and select the JRE and .
FAQ - How to install Java (JRE/JDK) so that LibreOffice could use it?
See also other operating systems.
Documentation / Manuals
Here you will find the Documentation / Manuals:
For questions on this topic go to:
Join us today and help us to make it even better!
LibreOffice is Free Software and is made available free of charge.
Your donation, which is purely optional, supports our worldwide community.
If you like the software, please consider a Donation.
- → Open Issues
Selecting the host / target system
Since core commit 114ed73a7ba56e013e6d7f886798915fb20c0946 (for more information: https://lists.freedesktop.org/archives/libreoffice/2020-September/085869.html), which basically translates to since LibreOffice 7.1, the old configure switch --enable-64-bit was dropped. To explicitly select your architecture, you have to supply the correct configure host triplet:
- --host=i686-pc-cygwin: target 32-bit Intel / AMD host
- --host=x86_64-pc-cygwin: target 64-bit AMD / Intel host
- --host=aarch64-pc-cygwin: target 64-bit ARM host (WIP, but should run in general - see bug tdf#137143)
For all versions before LibreOffice 7.1, the default build is always 32-bit on Windows and you must explicitly call autogen.sh/configure with --enable-64-bit to get a 64-bit build.
Otherwise your build and host system will be the same, detected by the configure script, which is probably what you want anyway.
Depending on your decision, you must install a Java version, matching the target architecture and bit count.
Example for Windows Arm64 cross-compile including Java
- --host=aarch64-pc-cygwin or --with-distro=LibreOfficeWinArm64
The first is the installed Oracle x86_64 Java, the 2nd is the unpacked pre-release of the Windows Arm64 OpenJDK Java.
Before you can start hacking LibreOffice on Windows, you need to follow these instructions to set up a build environment. Do also read our generic building hints.
Install Visual Studio
You need the Microsoft compiler/development suite Visual Studio, which can be obtained from here: https://visualstudio.microsoft.com/downloads/
There is an edition that is free of charge, the Community Edition, that includes everything needed to build all LibreOffice features: https://visualstudio.microsoft.com/vs/community/
Current master (since LibreOffice 7.0) requires Visual Studio 2019 (at least v16.4) (or the equivalent Visual Studio Build Tools).
Since VS 2017, a separate Build Tools package is available that includes compilers, and most toolchains and libraries without installing Visual Studio IDE: https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019
For older LibreOffice versions the required Visual Studio versions are:
- LibreOffice 4.4 requires Visual Studio 2012
- LibreOffice 5.0 requires Visual Studio 2013
- LibreOffice 5.4 requires Visual Studio 2015
- LibreOffice 6.2 requires Visual Studio 2017
- LibreOffice 6.3 can be built with either Visual Studio 2017 or 2019
Visual Studio 2019 can optionally install 2017 and 2015 compilers (VS 2015 / 2017 C++ Buildtools). The only thing missing are the older C++ Redistributable MSM packages, so older configure.ac scripts need a little patch to build MSI packages.
Older Visual Studio versions are available at https://visualstudio.microsoft.com/vs/older-downloads/
Visual Studio 2019
Visual Studio (and Visual Studio Build Tools) 2019 at least v16.5 work on current master. Select the Desktop development with C++ workload and check that all of the following components are selected individually:
- MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.2x)
- C++ core features
- Windows 10 SDK (10.0.xxxxx.x)
- Windows Universal C Runtime
- C++ ATL for v142 build tools (x86 & x64)
- .NET Framework 4.x.x SDK (.NET Framework 5.x SDK and .NET Framework 6.0 SDK pre-release versions are currently not supported. These don't register their information to registry, doesn't have csc.exe and they use dotnet command with csc.dll instead for compiling.)
- C++ 2019 Redistributable MSMs (only required to build MSI installer)
- C++ Clang Compiler for Windows (x.x.x)
If you want to cross-build for ARM64, you have to select the following additional components:
- MSVC v142 - VS 2019 C++ ARM64 build tools (v14.2x)
- C++ ATL for v142 build tools (ARM64)
You can select these options in the VS 2019 installer.
The redistributable MSMs (only required to build MSI installer) are not part of the workload selection in 2019, but need to be picked from the individual component selection. For details, see the comments to the VS Developer Community questions Where MergeModules for 14.20.27404.0 and 14.20.27508? and Deprecation of CRT redist MSMs?.
No matter what version of Visual Studio you're using, you need a
- Java Development Kit (JDK) Version 9 or later. Make sure to get a 32-bit SDK if you are building for32-bit Windows, and a 64-bit SDK if you are building for64-bit Windows. Grab it from adoptopenjdk.net or oracle.com (Oracle requires login to download).
Note that the Oracle JDK is 64-bit only.
Note that the AdoptOpenJDK installer will not be detected out of the box: you need to manually enable the 'JavaSoft (Oracle) registry keys' option for this.
If you're cross compiling to 64-bit ARM, you need to provide a different JDK for the build-tools and the target host. While the build-tools will detect the correct JDK eventually, you must use
--with-jdk-home=<Arm64 JDK directory> to provide the host JDK. You can override the build JDK by using
--with-build-platform-configure-options=--with-jdk-home=<x64 JDK directory>.
Install Cygwin and other dependencies
If you want to do it the hard way, continue reading.
Install Cygwin Requirements
On Windows, you must install Cygwin from www.cygwin.com.Suggested version: 2.11 or later.
The easiest way to do so is to download Cygwin's setup-x86.exe (32-bit) or setup-x86_64.exe (64-bit).
- It is preferable to use 64-bit Cygwin if possible, because it is less likely to have problems with fork() (see Cygwin FAQ for details).
This instruction uses the 64-bit version as an example: Run cmd and navigate to the download dir (if you have trouble navigating, you can also drag setup-x86_64.exe from the file explorer into the cmd window) and copy and paste the command below to run setup-x86_64.exe with the list of required packages preselected.
This launches the GUI and requires you to manually choose installation paths etc, but the packages passed via command line are pre-selected meaning you just need to accept the selection.
NOTE: installation path of Cygwin must not contain non-ASCII letters to avoid autogen.sh/configure problems (if it contains, move folder of the Cygwin installation to a new place and update its Windows shortcuts & Start Menu items).
Alternatively, run the setup-x86.exe or setup-x86_64.exe utility, switch the package view mode to 'Full' by pressing 'View' until 'Full' is displayed beside it, then manually select the packages listed in the above command for installation.
If you upgraded Cygwin, you might have to run the rebaseall command (not needed if you installed Cygwin for the first time):
Close all Cygwin consoles, run
c:cygwinbindash.exe and in the terminal, launch
After having installed Cygwin, open Cygwin command line by clicking on its desktop icon Cygwin64 Terminal, and perform next steps:
Install GNU Make
A Win32 build of GNU Make 4.0+ is made available (and required) for building LibreOffice.
It's easiest to put it in /opt/lo/bin, where configure will automatically find it; you can also use another location and set the MAKE variable.Either prepend /opt/lo/bin to PATH, or alternatively, when you build LibreOffice, always invoke 'make' with the absolute path /opt/lo/bin/make (or wherever you put it). LibreOffice can not and should not use Cygwin's /usr/bin/make.
Install ant and junit
You can extract them anywhere, they don't have to be installed. If you don't want to use Junit, it can be disabled with --without-junit in the autogen.sh command later.
Also works with the combination of junit 4.13,hamcrest 2.2and Apache Ant 1.10.8
Clone the LibreOffice source code repositories
NOTE: sources should be in a relatively short path to avoid exceeding the file/pathname limit and the destination path cannot have any space in it.
Optionally create build directory
You can build LibreOffice into another directory than your checkout. This helps keeping the source code tree clean and eases building multiple versions.
If you want to build into a separate directory, say /cygdrive/c/build, enter these commands:
Otherwise change directory to the /cygdrive/c/sources/libo-core folder:
Configure and build the code
Now run autogen.sh to configure the build:
Note that it's not recommended to use ccache on Windows. If you have it installed in your Cygwin environment, be safe and disable it with --disable-ccache (as in the command above).
If the autogen.sh script complains that it cannot find some header files, it is possible that it cannot locate the your Windows SDK or that it finds a corrupted one. This may happen if you installed multiple version of Visual Studio on your computer, especially if you installed a Beta version, and even if you uninstalled those. In this case, you may use the --with-windows-sdk=7.1A, possibly replacing 7.1A with another version of the SDK to select a specific uncorrupted version.
Save a copy of the last used parameters in the file autogen.input. It will not be overridden by autogen.sh when using other parameters. If autogen.sh is called again without parameters, it will fetch its input from autogen.input if it is present.
Read the summary output from the autogen.sh command. If it did not report any errors or relevant warnings, then all that is left to do is to run the right version of make to build LibreOffice. Before you do this, make sure your anti-virus software will not cause any problems.
If the build process fails at this point with the error error C3861: 'InetPtonW': identifier not found, this is because of a bug in the build process for Windows SDK 8. You may work around this by using the --with-windows-sdk=7.1A option.
When the build has finished without errors, you can run your fresh build of LibreOffice using
Microsoft Visual Studio Project Integration
The LibreOffice build system can generate project file for some IDEs including -- thanks to Honza Havlíček's excellent work -- Microsoft Visual Studio: (note that this does not allow a full build so you still need to use Cygwin to do full builds)
Build a project file for Visual Studio
The IDE integration script is written in python3, which is not installed by default (using the lode method), please install it in cygwin before running the make command. After a complete build of LibreOffice was successful, execute the following command to generate a Visual Studio project for Visual Studio 2019:
For Visual Studio 2017 use:
If the generation is successful, the resulting solution file
LibreOffice.sln will be placed in the root directory of the build and can be opened with Microsoft Visual Studio.
Note that if you use --enable-mergelibs, the generated solution will for unclear reason contain less projects, and have problems finding many symbols. Until that is fixed, it's advisable to avoid --enable-mergelibs when using IDE integration.
It is a frequently asked question, usually coming from free software purists, why we use proprietary compiler instead of a free one (i.e. gcc).
- ABI backwards-compatibility for compiled extensions. There is some resistance to breaking that.
- So far MSVC produces faster, smaller binaries.
- There are some features in the code that don't compile with MinGW. They use API that MinGW does not provide headers for etc.
- There are open questions around how we would run unit tests in a MinGW cross-compilation environment.
- There are open questions around how well gdb works on Windows; the MSVC C++ debugger is really quite good.
Something like the following in the autogen.input file is known to produce a working build:
Of course, change the information behind ='s to fit your needs; set the paths to what you have used when installing various prerequisites.
You also need to specify the path for ant with --with-ant-home=<cygwin path of ant>.
64-bit Visual Studio build
A port for 64-bit Windows is working on master with all supported compilers. To build it, use the
--enable-64-bit flag to configure before LibreOffice 7.1.
Notes on older and non-default MS compilers
Switching to non-default compiler
Specify which Visual Studio version to use in case several are installed.
If not specified, the order of preference is 2015, 2017 for libreoffice-6-1 (and older branches), 2019 is used for master.
Running Glade on Windows
To edit dialogs (.ui files), you need Glade. There is an old version for Windows but it doesn't support all properties that are needed for LibreOffice dialogs.
So you need to install Glade in Cygwin:
- Install Glade in Cygwin by running the Cygwin Setup, then install the following packages:
- Add this to your .bashrc:
- Open one Cygwin console and run:
- Open another Cygwin console and run:
That's it, you should now run Glade ≥ 3.18
Cygwin and git
The main problem is the cygwin-git is very slow.
The alternatives are:
- Install the win-git from here: https://gitforwindows.org/ (This installs a 'Git-Bash Here' in Explorer)
- Use Windows Subsystem for Linux (WSL) to install a Linux distribution (see e.g. https://www.sitepoint.com/wsl2-windows-terminal/ for how to install a distribution and optionally Windows Terminal)
Here are the times using the same computer and repo and not being the first call:
Git in WSL is slower than git-bash, but it has the advantage of working in a complete Linux environment with all other tools provided by the distribution. You should not mix tools from Cygwin and WSL (i.e. open separate terminals for Cygwin and for WSL).
NOTE: A mix between different git tools is not always compatible, when you change you should renew (clone) the git repositories.
Best to configure 'autocrlf' before cloning master, to avoid the problem (see below for how to set 'autocrlf' to a sensible value)
Executable permission on files
It is desirable to use
filemode = false in the
[core] section of
.git/config, to avoid all files having executable permission in cygwin-git. This setting allows Git to ignore the differences between filemodes of files on disk and in index, which is useful with cygwin-git, which sees all files on disk as having executable permission (755 instead of typical 644).However, sometimes you need to add a script file with executable permission, and with the mentioned setting, you would need to use an explicit command to set the permission to the added file:
Ref: git-update-index documentation.
You will use Cygwin Bash Shell for the whole build process. You must install all the build dependencies above before starting the shell to run autogen because autogen needs some environment variables to find the tools.
If you see an error similar to the following when running autogen.sh
This means that that Windows style newline characters are creating issues with the Cygwin Shell.The good way to solve this is to configure git to clone with UNIX line ending. To do so, give the following command in Cygwin Shell:
Big List Of Dodgy Apps
Libreoffice 32 Bit
If you get mysterious build breaks, building is very slow or your systems hangs totally, check if you are running an application which interferes with Cygwin. For a list of known offenders, see this point in the Cygwin FAQ.
Buildability of 'master'
Libreoffice 32 Bit Windows 7 & Windows10
If you are building the Windows build for the first time, it is recommended that you check the current state of https://tinderbox.libreoffice.org/MASTER/status.html . If you see recent 'green' builds, it is a good time to try - otherwise it might happen to you that you'll have to fix the build yourself. The buildability on Windows has improved recently with the introduction of the MinGW and more stable native Windows tinderboxes, but still there might be a day or two when 'master' is not buildable on Windows.
The usual recommendation is to just pull and try again, and once you have a build, don't pull in the tree any more, but do your hacking in it. Clone a different tree and iterate pulling and building in that until it again works, then switch. Repeat.
Alternatively, if you find a known good state (a green box) for Windows on the Tinderbox side back in history, you can do:
to start working on a branch starting at the last good state.
BitDefender / other Anti-Virus / security tools breaking the build
If your build fails with a FileNotFoundError: such as
The system cannot find the file specified: '../../../dist/out/binexample.exe', there's a good chance your Anti-Virus is quarantining or deleting important files.
Another potential source of problems are the sample documents (those labeled CVE) that check for known vulnerabilities to ensure they don't reappear again. In the source they are stored encrypted to avoid triggering the warnings, but when the corresponding test is run, the original is created in the temp directory and tools such as BitDefender can flag it.
If you want to run these tests, disable monitoring of the temporary build-directories
<root of repo>*pass and
C:cygwintmp in your Anti-Virus tool. For Windows 8 and 10 you will need to disable Windows Defender launch - search for and launch 'defender' from the shell.
You can also use the
--disable-cve-tests autogen flag to skip the tests that are known to cause trouble.
Also note that Anti-Virus tools can slow down your build quite a bit, if you want to build fast you should disable real time monitoring of the source tree and the temporary files directory
Norton Antivirus breaking the build
Norton Antivirus and Symantec Endpoint Protection complain about certain files that the build produces.It finds the following files (in a build without '--enable-dbgutil' )
Files with * are needed for the build - exclude them from the virus scan!
The following files appear with varying names (????) in a release build, so you cannot exclude them from the scan.
Current workaround: Don't do release builds (unless you are allowed/willing to switch off the virus scanner).
System PATH causing weird build breakage
If you experience weird build breakage that no one else seems to experience, check your PATH value and try cleaning it. Note that you need to open a new shell and re-run autogen.sh in order for the new system PATH value to take effect in your build. Some people have experienced a build failure in the shell module due to their system PATH including a path to an older OOo installation which had a DLL of the same name as the one that the build uses.
Windows Update automatically reboot during compilation
Sometimes Microsoft Windows reboot during compilation. It happen because Windows Update updates operating system and reboot.To stop windows update from command line, you can enter following command in command box:
It stops a Windows Update service process.
Failing PDF signing tests
On Windows, it can happen, that PDF signing tests are failing:
Solution: Remove expired Own Certificate: http://imgur.com/a/NdCxT
- Start certmgr
- proceed to Own Certificates
- Remove expired certificate
- Repeat the tests
Short filenames (8.3 filenames)
If you get an error like the following one:
Then ensure 8.3 name creation is enabled. Open the Command Prompt as administrator and run:
Also, check that the conflicting folder (in this case, 'Microsoft SDKs') has a corresponding 8.3 filename. For example:
This will print a list of folders beginning with 'M' and their associated 8.3 filenames. If 'Microsoft SDKs' does not have a short filename, you can rename it to 'tmp', then create a new folder 'Microsoft SDKs', check that it has a short filename and move the contents of 'tmp' to 'Microsoft SDKs'.
When choosing a directory in which to install LODE, please use the 8.3 rules. Windows does not correct environment variables, therefore e.g. LODE_HOME will be wrong and will cause problems. Therefore, always clone lode in a 8.3 path such as:
autogen.sh might report that it cannot find mscvc.exe.
This is caused by the long filename problem as well, but the solution is a bit more work:
Shift+reset, go to the safe mode, do this:
Correct your PATH variable
ALINK : error AL1078: Error signing assembly -- Access is denied
If you receive the following error :
Then open Developer Command Prompt for VS as an administrator, and use sn tool to set `AL.EXE` to use current user key set to sign assemblies instead of using machine key set:
This modifies the following registry keys:
for 64-bit systems:
for 32-bit systems:
See this stack overflow question and mail thread starting from this message for more information.
Other known problems
- Paths that include /opt cause problems with some external modules; it is best to avoid having your source tree in /opt; or use --disable-orcus to overcome this.
- Asian locale builds sometimes fail due to encoding issues in the source code; in these cases, patches to fix those problems are appreciated. Alternatively, configure Windows for a US locale.
Using a Windows program as your git editor
Libreoffice 32-bit Linux Download
Paths under Cygwin are an endless source of nightmares. This section documents using Notepad++ as your git editor under Cygwin. It assumes you are using the 64-bit version of Notepad++ (adjust the path, if using the 32-bit version).
Below you will find a wrapper script written by Gene Pavlovsky (original gist in GitHub).
- Save the script as cygrun.sh into the bin directory in Cygwin's root (so it is in the PATH). When saving the cygrun.sh using Notepad++, do this first to make sure it has Unix line endings: from the 'Edit' menu, select 'EOL Conversion' -> 'UNIX (LF)'.
- In a Cygwin shell inside the bin directory, give this command to create a symbolic link:
- Give this command in your home directory: or alternatively edit your .gitconfig to contain this editor block: The --wait is important, as it forces git to wait until you close the file.
Bonus: if you want to define Notepad++ as the default editor of your shell and also access it through a handy 'np' alias, add these to the .bashrc file in your home directory:
Remember to be very careful with the line endings, when creating new files and use the Edit -> EOL Conversion.
The cygrun script: