Summary: | Java path not found nor selectable after upgrade | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Daniele <grassode> |
Component: | LibreOffice | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | CC: | iplaw67 |
Priority: | medium | ||
Version: | 7.4.3.2 release | ||
Hardware: | ARM | ||
OS: | macOS (All) | ||
Whiteboard: | |||
Crash report or crash signature: | Regression By: | ||
Attachments: |
Empty advanced java options
Java JDK found Java JDK found and selected Location of java on disk |
Description
Daniele
2022-12-22 11:37:59 UTC
I cannot confirm the issue (however, I only have installed 1 JDK (Oracle JDK) rather than multiple JDKs, installed in the OS's intended default location below /Library/Java/JavaVirtualMachines/), see attached screenshots. Version: 7.5.0.1 (AARCH64) / LibreOffice Community Build ID: 77cd3d7ad4445740a0c6cf977992dafd8ebad8df CPU threads: 10; OS: Mac OS X 13.1; UI render: Skia/Metal; VCL: osx Locale: de-DE (de_DE.UTF-8); UI: de-DE Calc: threaded % /usr/libexec/java_home /Library/Java/JavaVirtualMachines/jdk-19.jdk/Contents/Home % /usr/libexec/java_home -V Matching Java Virtual Machines (1): 19.0.1 (arm64) "Oracle Corporation" - "Java SE 19.0.1" /Library/Java/JavaVirtualMachines/jdk-19.jdk/Contents/Home /Library/Java/JavaVirtualMachines/jdk-19.jdk/Contents/Home Manpage java_home: % man java_home @Daniele: Where are your Java JDKs (a JDK contains a JRE) installed? In the default location, Apple has intended for JDKs to be installed in macOS (means: below /Library/Java/JavaVirtualMachines/)? And: do you have set the environment variable JAVA_HOME in your ~/.bash_profile, ~/.zprofile or ~/.profile to set, which one of your several JDK-installations should be taken and preferred (instead the first one, which is found by java_home per default, if no further specific option is given)? For instance (examples): ## JAVA_HOME export JAVA_HOME=$(/usr/libexec/java_home) or # Most recent stable Java VM: 19 VM # Either take/print a 19 VM or, if failing, take/print nothing, if neither is found. export JAVA_HOME=$(/usr/libexec/java_home -F -v 19) or # Either take/print a 19 VM or, if failing, take/print a 18 VM or nothing, if neither is found. export JAVA_HOME=$(/usr/libexec/java_home -F -v 19 || \ /usr/libexec/java_home -F -v 18) or # Either take/print a 19 VM or, if failing, take/print a 18 VM or, if failing, take/print a 17 VM or nothing if neither is found. export JAVA_HOME=$(/usr/libexec/java_home -F -v 19 || \ /usr/libexec/java_home -F -v 18 || \ /usr/libexec/java_home -F -v 17) See also: Apple Developer: Technical Q&A QA1170: Important Java Directories on Mac OS X –> Section JAVA Home https://developer.apple.com/library/archive/qa/qa1170/_index.html#//apple_ref/doc/uid/DTS10001702-CH1-SECTION1 Apple Developer Forum: How does /usr/libexec/java_home know where are my jdks are installed? https://developer.apple.com/forums/thread/681025 Mykyong.com, January 19, 2021: How to Set $JAVA_HOME environment variable on macOS https://mkyong.com/java/how-to-set-java_home-environment-variable-on-mac-os-x/ Created attachment 184500 [details]
Java JDK found
Created attachment 184501 [details]
Java JDK found and selected
@Daniele : in addition to Sierk's comments, your JDK needs to match the build architecture for the version of LO. If your Mac has a x86_64 (Intel and compatible) processor, then you should be using x86_64 versions of the JDK. If your Mac has an Arm processor, then you should be using an Arm version of LO with an aarch (aarch64) version of the JDK. You can't mix and match the two types. BTW, I couldn't get any Oracle JRE recognized by LO, even with correct architecture matching. There is an additional complication in that not all versions of a JDK aarch64 are recognized either, for example : Version: 7.4.3.2 / LibreOffice Community Build ID: 1048a8393ae2eeec98dff31b5c133c5f1d08b890 CPU threads: 8; OS: Mac OS X 13.0.1; UI render: Skia/Raster; VCL: osx Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR Calc: threaded finds the following two JDKs : Temurin file /Library/Java/JavaVirtualMachines/temurin-18.jdk/Contents/Home/bin/java /Library/Java/JavaVirtualMachines/temurin-18.jdk/Contents/Home/bin/java: Mach-O 64-bit executable arm64 and also : Oracle file /Library/Java/JavaVirtualMachines/jdk-17_aarch64.jdk/Contents/Home/bin/java /Library/Java/JavaVirtualMachines/jdk-17_aarch64.jdk/Contents/Home/bin/java: Mach-O 64-bit executable arm64 but it won't recognize: liberica-jdk-16-full.jdk (aarch64) or zulu-17.jdk (aarch64). Hi @Sierk Bornemann, thank you for following up. My Java VM are in Macintosh HD/Library/Java/JavaVirtualMachines/ I think that they previously were in Macintosh HD/Users/USERA/Library/Java/JavaVirtualMachines/ because it took me a long time to find them, but I cannot be sure. Do not know either when/how they were moved (not by me at any rate). Maybe when I moved to Monterey? as to your second question: "And: do you have set the environment variable... etc." I am really not familiar with these things. All I do is go to https://adoptium.net/temurin/releases/ choose the right release and then install it. But as @Alex Thurgood pointed out, I might have chosen the wrong one. So I am choosing now the aarch64. Downloaded and installed it. Deleted the other two. I closed LO and re-opened it. Got the same error message. Went manually to (tried both clicking on add and class path) /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/bin/ LO will not see the java (they are all greyed out) and I get the error message: The folder you selected does not contain a Java runtime environment. Please select a different folder. I hope this helps. I do not know if this is possible: but it would be great if LO worked "out of the box": the average user (who will at the most download and install LO without going to Preferences) would highly benefit from it! Maybe an error message from LO pointing to a java download page (and instructions on what to do)? Thanks! (In reply to Daniele from comment #7) > Hi @Sierk Bornemann, > > thank you for following up. > > My Java VM are in Macintosh HD/Library/Java/JavaVirtualMachines/ > > I think that they previously were in Macintosh > HD/Users/USERA/Library/Java/JavaVirtualMachines/ > > because it took me a long time to find them, but I cannot be sure. Do not > know either when/how they were moved (not by me at any rate). Maybe when I > moved to Monterey? > > as to your second question: "And: do you have set the environment > variable... etc." I am really not familiar with these things. All I do is go > to https://adoptium.net/temurin/releases/ > > > choose the right release and then install it. But as > > @Alex Thurgood pointed out, I might have chosen the wrong one. So I am > choosing now the aarch64. Downloaded and installed it. Deleted the other two. > > I closed LO and re-opened it. > > Got the same error message. > > Went manually to (tried both clicking on add and class path) > /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/bin/ > Theoretically, you shouldn't need to point it to the /bin directory, just the /temurin-17.jdk/ folder. However, it might well be that temurin-17.jdk isn't recognized. As I said, not all versions are recognized. > I do not know if this is possible: but it would be great if LO worked "out > of the box": the average user (who will at the most download and install LO > without going to Preferences) would highly benefit from it! Maybe an error > message from LO pointing to a java download page (and instructions on what > to do)? Thanks! I would love for this to be possible, but the whole sorry Java recognition business has been a long standing debacle due to the fact that Apple and Oracle fell out, and the LO project has been trying to play keep up for functionality that it has wanted to make entirely optional and not yet succeeded without losing key functionality, well, because people actually still use Java on a day-to-day basis with their office productivity suite. (In reply to Daniele from comment #7) > Hi @Sierk Bornemann, > > thank you for following up. > > My Java VM are in Macintosh HD/Library/Java/JavaVirtualMachines/ > > got the same error message. > > Went manually to (tried both clicking on add and class path) > /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/bin/ > Why aren't you using temurin-18.jdk? Hi @Alex, thank you for your detailed answers also on the history of Java.
I installed temurin-18.jdk, and from LO preferences advanced pointed to
Macintosh
> HD/Users/USERA/Library/Java/JavaVirtualMachines/temurin-18.jdk
but got the same error message.
The previous version of LO found it without any issue, but somehow now that it is higher up in the file system it won't fetch it.
I am also happy to use any other java version that works.
(In reply to Daniele from comment #10) Hi @Daniele, > Macintosh > > HD/Users/USERA/Library/Java/JavaVirtualMachines/temurin-18.jdk > > > but got the same error message. > Ah, pretty certain that that's the wrong place to put your JDK in. It needs to go in the system /Library/ folder (and not the user Library folder) under the corresponding /JavaVirtualMachines/ directory. Created attachment 184518 [details]
Location of java on disk
@Alex, sorry I copied from a previous message hastily and wrote it wrongly. This is the path it was installed to: Macintosh HD/Library/Java/JavaVirtualMachines I am also attaching a screenshot of the details (In reply to Daniele from comment #13) > @Alex, sorry I copied from a previous message hastily and wrote it wrongly. > This is the path it was installed to: Macintosh > HD/Library/Java/JavaVirtualMachines > I am also attaching a screenshot of the details @Daniele, thanks for the update! Very strange that LO doesn't recognize the JDK there. That's exactly where all of mine are. The only other thing I can think of would be a permissions problem, possibly due to a recent macOS update? Sorry I can't be of more help. Hi @Alex and @Sierk Borneman, An update: I updated Mac Os to the latest Ventura 13.2 then reinstalled Libreoffice (see version below), deleted both instances of Java and reinstalled Java as well from https://adoptium.net/temurin/releases/ . Now everything works fine. Thank you so much for your help. Version: 7.4.4.2 / LibreOffice Community Build ID: 85569322deea74ec9134968a29af2df5663baa21 CPU threads: 8; OS: Mac OS X 13.2; UI render: default; VCL: osx Locale: it-IT (en_IT.UTF-8); UI: en-US Calc: threaded |