JRE Alert On Opening LO

Every time I open LO, I get the following 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.

I follow the instructions and I am told that the proper JRE is installed.

How do I get rid of this message?

Please edit the question to indicate the operating system.