Java installed but not recognized

When using Database I receive a message saying that I need a new version of Java. I’ve installed it, but LibreOffice is asking me again and again each time that I need to actualize the Java version. Same occurs after reinstall Java, reinstall LibreOffice and restart the computer. I Can’t use the program at all.
My OS is Mac OS Sierra.
Thanks for your help

For Mac, you need to install Oracle JDK and not JRE. The needed JRE is in JDK but because of other situations between Apple & Oracle only the JDK contains verification info needed by the OS.

Also under Preferences, make sure Use a Java runtime environment is selected:

image description

If this answers your question please click on the :heavy_check_mark: (upper left area of answer).

Thanks very much. Your answer has been very useful.