Bug 148323 - M1, apple silicon languagetool installation bug: The service com.sun.star.loader.Java2 cannot be instantiated
Summary: M1, apple silicon languagetool installation bug: The service com.sun.star.loa...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Extensions (show other bugs)
Version:
(earliest affected)
7.2.6.2 release
Hardware: ARM macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-02 10:58 UTC by Anduril
Modified: 2022-04-06 14:07 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
The way advanced section (java) looks in preferences (78.31 KB, image/jpeg)
2022-04-02 10:59 UTC, Anduril
Details
The way Languagetools looks in Extension Manager after installation (50.68 KB, image/jpeg)
2022-04-02 11:00 UTC, Anduril
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anduril 2022-04-02 10:58:30 UTC
Description:
Hi, after upgrading to 7.2.6.2, languagetool extension stopped working, so I tried removing it and reinstalling it.

I get this message during installation:

ImplementationRegistration::registerImplementation() - The service com.sun.star.loader.Java2 cannot be instantiated

I had a look at a number of discussions on this topic around the web and installed a number of different Java flavors:

jdk-14.0.2_osx-x64_bin
jdk-17.0.2_macos-aarch64_bin
jre-8u321-macosx-x64
JavaForOSX (I could not install this one since I get the message that a more recent version has been installed)

Languagetool version is the latest: LanguageTool-5.7, but also tried to downgrade to 5.6, 5.4, with no improvement.
Also tried reinstalling LO after having installed the Java packages. No improvement.

Screenshot 1 my advanced settings in LO 

Screenshot 2: how the Languagetool Extension looks Extension manager

Any help is welcome!



Steps to Reproduce:
1. Install 7.2.6.2
2. Install extension Languagetool 5.7
3. You should see the error message in description

Actual Results:
Languagetool 5.7 does not work

Expected Results:
Languagetool 5.7 should be flawlessly installed


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 7.2.6.2 / LibreOffice Community
Build ID: b0ec3a565991f7569a5a7f5d24fed7f52653d754
CPU threads: 8; OS: Mac OS X 12.2.1; UI render: default; VCL: osx
Locale: it-IT (it.UTF-8); UI: en-US
Calc: threaded
Comment 1 Anduril 2022-04-02 10:59:41 UTC
Created attachment 179274 [details]
The way advanced section (java) looks in preferences
Comment 2 Anduril 2022-04-02 11:00:17 UTC
Created attachment 179275 [details]
The way Languagetools looks in Extension Manager after installation
Comment 3 Alex Thurgood 2022-04-05 11:12:45 UTC
@Anduril : your JDK isn't recognized, probably because you are using a build architecture version of LO that doesn't correspond to the installed system JDK architecture.

If you use LO built for Arm M1, then you need a compatible Arm M1 JDK.
Similarly, if you are using an Intel version of LO, then you need the corresponding Java for Intel JDK.

On macOS, you can actually have both installed. For example, I have :
Oracle JDKs

/Library/Java/JavaVirtualMachines/jdk-17_aarch64.jdk/

and

/Library/Java/JavaVirtualMachines/jdk-17_x64.jdk/

in order for LO to recognize the installed JDK depending on whether I'm using an Intel build of LO, or a Arm M1 build of LO.
Comment 4 Anduril 2022-04-06 06:50:59 UTC
Thank you Alex,
I had the right build of Java (among others).
My problem was solved upgrading to LO 7.3. I received the suggestion from Asklibreoffice in this thread: https://ask.libreoffice.org/t/installation-problem-m1-apple-silicon-java2-cannot-be-instantiated-languagetool/75985/3
I hope this helps. Now everything is going well.
Comment 5 Alex Thurgood 2022-04-06 14:07:47 UTC
Per comment 4, WFM.