Java runtime environment is defective

Hi,
I am getting the following annoying error message every time when I try to start LibreOffice.
I have installed Java Runtime Environment on my system but the error message popped up.
I tried to reinstall both applications but the same error displayed.
How can I avoid these weird messages?
Have any idea?
Thanks for any help.

JRE is Defective
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 _ Java
