Mac 'El Capitan' fails to find java

I have installed Oracle’s JDK 8 on Mac OS X El Capitan in an attempt to allow Libre Office (LO) macro within a Spreadsheet and also for database use. I have had partial success, but any of the changes I make in the ‘Security’ setting i.e. Macro-Security-change to Medium, ‘Trusted folder’ etc are lost on exit from LO; bringing me back to square one.

It also seems impossible to create a database within LO for clearly connected reasons relating to the (alleged) absence of JRE.

I believe that there may be something specific about the ‘El Capitan’ O/S which seeks to prevent a smooth ride in this department, and as a newbie to the MAC environment at least any advice would be appreciated.