Fixing LibreOffice JRE Errors

, , Comments Off on Fixing LibreOffice JRE Errors

I’ve been using LibreOffice, and it’s predecessor OpenOffice, for creating documents & spreadsheets for more than a decade. Up until now my document creation and spreadsheet formating needs have been pretty basic. Rarely have I needed to do any formatting beyond changing a font size or making the text bold. In other words, the default installation of LibreOffice has always been sufficent for my needs. Because it has, I’ve never had a need to change any of the advanced customization options of either LibreOffice Writer or Calc. They have both ‘just worked’. At least until I tried to export a spreadsheet as a HTML5 formatted document and Calc presented me with the error message.

“LibreOffice requires a Java runtime environment (JRE) to perform this task. The selected JRE is defective. Please select another version or install a new JRE and select it under Tools – Options – LibreOffice – Advanced”

Fortunately, the solution wasn’t difficult to implement but it did take more than a few minutes to find. Hence the reason for this post. If I ever need to find the solution again, I won’t have to hunt through a bunch of Google search results which are mostly several years out of date. I’m sure they were valid at the time their authors posted them in the various forums and blogs, but the majority of their solutions frankly aren’t revelant today.

The one thing most of the posts did agree on was that I needed to set the location of the JRE in Options Menu under Advanced. Sure enough when I checked the setting in Advanced Customization of LibreOffice that entry was blank.

All I needed to was to find out where the JRE was installed so I could set the path. Problem was I couldn’t find any folders containing JAVA or a JRE.

which java

returned no listing

dpkg -l | grep openjdk

returned nothing as well.

Honestly I was quite surprised to discover my machine didn’t have Java or a Java Runtime installed. It has been nearly four years since I first installed Linux Mint 18 on it and I would have thought sometime in the past four years I would have attempted to use an application that required a JRE. Apparently, I hadn’t.

This was where the majority of the search results revealed how out of date they were. Eventually I came across a page with the correct solution on this site : Libreofficehelp.com.

I simply needed to install the default-jre and libreoffice-java-common packages

sudo apt install default-jre

sudo apt install libreoffice-java-common

Once both packages were installed, I closed Libre Office Calc and re-opened it. When I checked the Advanced options it showed Java was installed and exporting the spreadsheet to HTML5 completed successfully.