Libreoffice needs Java?

I’m trying to set up a database in LibreOffice, yet this needs a newer version of Java. I’m running MacOs High Sierra 10.13.6.
When I try to use Libreoffice, despite installing Java, i get a “Java not installed” message. So which version of Java should I install, please? A link to the correct site would be helpful too.
Thanks in advance.

can this help?

On macOS you need to install JDK (not JRE)