Libre Office not working, states I need to install Java?

Have just installed LibreOffice but it will not work when I try to open a file message appears stating I need to install Java.
I have the latest version of Java installed but it obviously can’t find it. What am I doing wrong?

Feel free to read the existing answers.

Enter the term “Java” in the upper bar.

Many answers are helpful.

… or read FAQ - Install Java

and

I have the latest version of Java installed but it obviously can’t find it.

This doesn’t tell some important facts

  1. Which version?
  2. Which bitness (32-bit, 64-bit)?
  3. Which Java exactly (This is important, since you need JDK, if your are on macOS)

(If you want specific help you need to provide specific information and using the phrase “latest” is not specific at all)