How to add openjdk java executable to LO on macOS

I have installed Libre office through HomeBrew Cask:

brew cask install libreoffice

Now I want to install the LangiageTool entention. I have LanguageTool also installed via HomeBrew:

brew install languagetool

which also automatically installs OpenJDK, which I also prefer over proprietary Oracle Java JDK. Now when I want to install the LT’s extension I get the error message:

Extension manager: Could not create Java implementation loader

According to here on mac I have to go to

  • menu bar: LibreOffice: > Preferences
  • left panel select Advanced
  • and then add the Java JRE:

from terminal running

which java

I know the java executable (or at least its symlink) is at /usr/bin/java. However, I don’t know what should I do next. I would appreciate it if you could help me know how I can solve this problem in a clean and canonical way. Thanks for your support in advance.

After a long Twitter discussion, I think I solved the problem. You need to install the Cask java:

brew cask install java

Though it recognizes the Oracle Java wrongly it works anyway. Why it does not work with the other one I have no idea ¯\_(ツ)_/¯