OpenJDK on MacOS

Issues installing under the Mac OSX - X11 - Aqua
Post Reply
wingman
Posts: 4
Joined: Thu Dec 12, 2019 12:43 pm

OpenJDK on MacOS

Post by wingman »

I have set up openjdk 11 with home-brew, symlinking /usr/local/opt.openjdk@11/libexec/openjdk.jdk/ to /Library/Java/JavaVirtualMachines/openjdk-11.jdk/

I can run java in the terminal and other software can find the JDK/JRE. Libreoffice 6.3 does not detect a java environment. I have tried manually specifying the location, but /Library/Java/JavaVirtualMachines/ nor /Library/Java/JavaVirtualMachines/openjdk-11.jdk/ nor usr/local/opt.openjdk@11/libexec/ nor /usr/local/opt.openjdk@11/libexec/openjdk.jdk/ are recognized.

How can I have LibreOffice use the openjdk environment? Is it possible at all, if not, why not?
Libreoffice 6.3 on macOS 10.15
User avatar
MrProgrammer
Moderator
Posts: 4906
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: openjdk on macOS

Post by MrProgrammer »

Hi, and welcome to the forum.
wingman wrote:Libreoffice 6.3 does not detect a java environment.
Note that you must restart the suite after installing Java. I use neither LibreOffice nor JDK but you can read advice about using JRE if you need Java to work.
[Tutorial] Mac FAQ Q06/A06
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
wingman
Posts: 4
Joined: Thu Dec 12, 2019 12:43 pm

Re: openjdk on macOS

Post by wingman »

Thank you for responding.

I had read the documentation, but I see no reason why it does not work with openjdk, as LibreOffice works with openjdk on other platforms.

What could cause this issue? other software works fine with openjdk 11 and the java environment is set up normally. Is LibreOffice for macOS hardcoded to only use oracle's java versions?
Libreoffice 6.3 on macOS 10.15
User avatar
RoryOF
Moderator
Posts: 34613
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: openjdk on macOS

Post by RoryOF »

You could manually enter the path to the Java in /Preferences /Options OpenOffice : Java

The entry might be something like /usr /lib /jvm /java-11-openjdk-something
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
wingman
Posts: 4
Joined: Thu Dec 12, 2019 12:43 pm

Re: openjdk on macOS

Post by wingman »

RoryOF wrote:You could manually enter the path to the Java
I had tried that already, and have tired again, but is does not work. I have no idea why, that there is a symlink to reach the path is the only obvious difference with the oracle jdk (except of course the differences inherent to openjdk vs oracle jdk). Permissions are correct and the directory structure of the jdk looks identical.
Libreoffice 6.3 on macOS 10.15
User avatar
RoryOF
Moderator
Posts: 34613
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: openjdk on macOS

Post by RoryOF »

I'm not a Mac user, so can only make a wild suggestion. From memory, some versions of macOS require Oracle Java 6 installed before they will recognise later Java versions; whether this is so in your case, I cannot say. But you need advice from an experienced Mac user, not from me.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
wingman
Posts: 4
Joined: Thu Dec 12, 2019 12:43 pm

Re: openjdk on macOS

Post by wingman »

OpenJDK is working fine for other applications. I have now installed the OracleJDK in parallel, which is recognized by other applications as well as LibreOffice.

Specifically LibreOffice appears to have issues with openjdk, no other application I have tested.
Libreoffice 6.3 on macOS 10.15
User avatar
MrProgrammer
Moderator
Posts: 4906
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: openjdk on macOS

Post by MrProgrammer »

wingman wrote:What could cause this issue? … Specifically LibreOffice appears to have issues with openjdk, no other application I have tested.
Look at these LibreOffice issues, perhaps starting with 101956. Remember that this is a user-to-user forum. You won't find developers here. I am done helping with this topic.

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Post Reply