LibreOffice Base not finding Java for MacOS

I searched through previous posts on this but did not find a solution. I am trying to use LibreOffice Base to create, modify and work with a database. I am able to create a database and run queries but not add a new table as I get errors saying that Java JDK must be running.

iMac - M4 - 2024 - Sequoia 15.3.1

I ran Oracle’s Java uninstalled successfully and then reinstalled latest Java -

Java™ SE Runtime Environment (build 21.0.1+12-LTS-29)

Java HotSpot™ 64-Bit Server VM (build 21.0.1+12-LTS-29, mixed mode, sharing)

LibreOffice version 25.2.1.2

I am trying to add the path to it from LO preferences - Advanced - Java options. I located java in /Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home/bin but it is greyed out in LibreOffice selection panel.

Actually this doesn’t sound right. If you have no java, then you should not be able to even see tables for an HSQLDB.
.
But, if your database is not java- or jdbc-based, then a newer java will not help.
.
Java with MacOS has several problems:

  • If you use LibreOffice from the Mac-Appstore, it will not use any java. (Against store rules). So you need a version from TDF.
  • As you can use x86 in emulation or ARM version, keep an eye not to mix this. IMHO you need to use the same architecture for LO and java.
  • And for long times only a jdk-install fullfilled the needs, while other platforms only require the runtime. I don’t know, if this recently changed.
1 Like

Hopefully, both the version of LibreOffice and the version of Java are compiled for aarch64? They need to match.

As @Wanderer has mentioned, a SE runtime is usually not sufficient on macOS, you need the whole JDK.

Unfortunately, while Oracle puts the SE in a path that says JDK, in my experience, it doesn’t include the whole JDK if you have only installed the runtime.

On top of that, in the past at least, some (sub)versions of Oracle’s JDK randomly have not been recognised by LO.

This is why I tend to prefer Temurin JDK which I install via Homebrew.

As @Wanderer has also mentioned, the version of LibreOffice from the AppleStore is not “Java-aware”, due to Apple’s rules on calling out to external “unapproved” executables.

It might help narrow down the problem if we knew:

  • the architecture of your LibreOffice version;
  • the provenance of your LibreOffice version (e.g. appstore, Homebrew, LO download site)
  • the architecture of your Java SE.

Having just checked my installation on my Macbook, my Java version recognized by LO 25.2.1.2 (aarch64)downloaded from the LibreOffice download page is:

openjdk version “23.0.2” 2025-01-21
OpenJDK Runtime Environment Temurin-23.0.2+7 (build 23.0.2+7)
OpenJDK 64-Bit Server VM Temurin-23.0.2+7 (build 23.0.2+7, mixed mode, sharing)

found by LO in /Library/Java/JavaVirtualMachines/temurin-23.jdk/Contents/Home