Connecting to Java in MacOS Ventura

I am running LibreOffice 7.5.3.2 in MacOS 13.5.2. I cannot get LibreOffice to recognize my Java installations. Following advice at this link (Connecting to Java on Ventura 13.2.1) I have installed JDKs in the JavaVirtualMachine folder. I have JDK17, 18.0.2.1, and 20. LibreOffice does not recognize any of these. When I select one in the Advanced->Java Options->Add menu, it says “The folder you selected does not contain a Java runtime environment. Please select a different folder.”

I was having the same problem when using 13.2.1. Someone sent me this answer: You’re using the wrong path.

For some reason, Oracle still installs the JRE on a user level to the internet plug-ins folder, probably because it presumes that the JRE will only ever be used with internet browsers.

LibreOffice stopped using the internet plugin folder ages ago.

The JDK needs to be installed into :

/Library/Java/JavaVirtualMachines/

This is a system folder and you will need admin privileges to either copy the JVM folder that you have previously unzipped elsewhere, or if an installer is provided, to allow the install script to install the corresponding PKG from a downloaded DMG (Oracle).

Not all JDKs are recognized after installation because the allowed minimum version is hardcoded into LibreOffice. Try with a JDK17 or JDK18, rather than a JDK19, and also, you might have to try various JDK providers until you find one that is recognized by LO. For what it is worth, I have an Oracle JDK18 which is recognized by LibreOffice.

Also note, and this is probably the most important thing, if you are using LibreOffice from the app store, then no amount of faffing with JDKs will work. Quite simply, all Java Code calls have been removed from the product distributed via the app store, apparently because it is one of the rules of being allowed into the store in the first place.

If you need Java functionality in LibreOffice for Mac, remove the app store version and download LibreOffice from the LO website download page.

I think I did not end up using it. Somehow, somewhere along the line, it just started working. I wish I could give you better info, but I really have no idea why everything started to work.

Now that it is working, I still get some bugs. Mostly it has to do with font and color. If you get it working and have those problems, I can actually give you a response that I know works.

Thanks, but I had already read that post and followed the suggestion. I have installed JDK17, JDK18 and JDK20 in /Library/Java/JavaVirtualMachines/, and LibreOffice still tells me that there is no Java runtime environment.

Todd:

For what it’s worth. I went into my library, and there was a Java folder. Within that folder, were two subfolders: Extensions and JavaVirtualMachines. Within JavaVirtualMachines there were two more folders, jdk-18.jdk and jdk-20.jdk

Whether they downloaded to there I don’t know. I know that I did not move them there.

Update: I figured out the issue. I was using the MacOS Intel version of LibreOffice, but my computer uses Apple Silicon. I had downloaded the correct versions of the JDKs, but I hadn’t even realized that LibreOffice also came in two flavors depending on the chip. Once I installed the correct version of LibreOffice, it recognized the JDKs with no issue.