[SOLVED] JNI Exception Linux Mint 20.1

edited January 30, 2021
I cannot get Zotero to work with Libreoffice since upgrading to Linux Mint 20.1 Ulyssa. I have followed the instructions here to no avail.

https://www.zotero.org/support/word_processor_plugin_troubleshooting#jni_exception

$ inxi -S
System: Host: TP-P1-Gen-2 Kernel: 5.4.0-64-generic x86_64 bits: 64 Desktop: Cinnamon 4.8.6 Distro: Linux Mint 20.1 Ulyssa

$ libreoffice --version
LibreOffice 6.4.6.2 40(Build:2)

$ java --version
openjdk 11.0.9.1 2020-11-04
OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04, mixed mode)

  • This is a problem with LibreOffice not being able to use your JRE and not specific to Zotero. You should try different versions of Java. Make sure LibreOffice sees them and they are selected when testing.
  • Thanks for your feedback. I took your advice and tried very version of JRE available.

    In the case of Oracle JREs, they all appear to be linked to "oracle-java15-jre". See my attempt to install "oracle-java12-jre". There appears to have been some sort of license change and Oracle don't readily give access to earlier versions.

    ~$ sudo apt install oracle-java12-jre
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Note, selecting 'oracle-java15-installer' instead of 'oracle-java12-jre'
    oracle-java15-installer is already the newest version (15.0.2-1~linuxuprising0).
    The following packages were automatically installed and are no longer required:
    linux-headers-5.4.0-62 linux-headers-5.4.0-62-generic
    linux-image-5.4.0-62-generic linux-modules-5.4.0-62-generic
    linux-modules-extra-5.4.0-62-generic python3-dbus.mainloop.pyqt5
    python3-notify2
    Use 'sudo apt autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.


    In the case of OpenJDK I have tried all the available versions.

    ~$ apt search openjdk| grep -e '-jre '
    i openjdk-11-jre - OpenJDK Java runtime, using Hotspot JIT
    i openjdk-13-jre - OpenJDK Java runtime, using Hotspot JIT
    i openjdk-14-jre - OpenJDK Java runtime, using Hotspot JIT
    i openjdk-8-jre - OpenJDK Java runtime, using Hotspot JIT

    These equate to the following in LO.
    Ubuntu 11.0.9.1
    Private Build 13.0.4
    Private Build 14.0.2
    Private Build 1.8.0_275

    Running the "Zotero_OpenOffice_Integration.oxt" file in each case results in me initially getting the information box:

    -----------------------------------------------------------------------------------
    You are about to install version 5.0.23 of the extension ‘Zotero
    LibreOffice Integration’.
    That version is already installed.
    Click 'OK' to replace the installed extension.
    Click ‘Cancel’ to stop the installation.
    -----------------------------------------------------------------------------------

    and when I do click connect I receive the following message:

    -------------------------------------------------------------------------------------------------------
    (com.sun.star.uno.RuntimeException) {{ Message = "JNI exception occurred”,
    Context = (com.sun.star.uno.Xinterface) @7F1bcc0017F8
    (ImplementationName = "com.sun.star.comp.stoc. JavaVirtualMachine") } }
    -------------------------------------------------------------------------------------------------------

    I have been using Zotero for over a decade now, it has gotten me through a MSc dissertation and a PhD thesis. It has worked pretty solidly over that time, except for a bit of a hickup when the standalone version was forced instead of the browser versions. I would really like to continue using it and I fear that I have done as much in terms of reporting as I can (I will also open a ticket with LO but you might have more clout to get something fixed, particularly if you can do some more detailed troubleshooting to point ot the exact problem.
  • This is something specific to your setup — it's not something we can report. Obviously a huge number of people on Linux are happily using Zotero with LO.

    I'd recommend trying the JDK directly from Oracle if you haven't yet (though you'll need to look up how/where to install those on your system):

    https://jdk.java.net
  • I uninstalled LibreOffice and Zotero and reinstalled everything again. For Zotero I downloaded directly and followed the instructions here: https://www.zotero.org/support/installation. Here is the error reported in Zotero:

    [JavaScript Error: "TypeError: temp is null" {file: "chrome://zotero/content/bindings/preferences-unix.xml" line: 1225}]
    getPreferenceElement@chrome://zotero/content/bindings/preferences-unix.xml:1225:11
    userChangedValue@chrome://zotero/content/bindings/preferences-unix.xml:1273:25
    onxblcommand@chrome://zotero/content/bindings/preferences-unix.xml:1312:9


    [JavaScript Error: "uncaught exception: unopkg at /usr/bin/unopkg failed to install"]

    [JavaScript Error: "TypeError: temp is null" {file: "chrome://zotero/content/bindings/preferences-unix.xml" line: 1225}]
    getPreferenceElement@chrome://zotero/content/bindings/preferences-unix.xml:1225:11
    userChangedValue@chrome://zotero/content/bindings/preferences-unix.xml:1273:25
    onxblcommand@chrome://zotero/content/bindings/preferences-unix.xml:1312:9


    [JavaScript Error: "uncaught exception: unopkg at /usr/bin/unopkg failed to install"]

    version => 5.0.95, platform => Linux x86_64, oscpu => Linux x86_64, locale => en-US, appName => Zotero, appVersion => 5.0.95, extensions => Zotero LibreOffice Integration (5.0.25.SA.5.0.95, extension)

  • Those aren't relevant. This has nothing to do with Zotero — it's entirely a problem in LibreOffice with your system Java configuration.

    Again, see what I said above about trying a JDK from Oracle.
  • Thank you for coming back to me. You will see in the initial information I sent today that I did try the Oracle JDK. In the case of Oracle JREs, they all appear to be linked to "oracle-java15-jre". See my attempt to install "oracle-java12-jre". There appears to have been some sort of license change and Oracle don't readily give access to earlier versions.

    ~$ sudo apt install oracle-java12-jre
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Note, selecting 'oracle-java15-installer' instead of 'oracle-java12-jre'
    oracle-java15-installer is already the newest version (15.0.2-1~linuxuprising0).
    The following packages were automatically installed and are no longer required:
    linux-headers-5.4.0-62 linux-headers-5.4.0-62-generic
    linux-image-5.4.0-62-generic linux-modules-5.4.0-62-generic
    linux-modules-extra-5.4.0-62-generic python3-dbus.mainloop.pyqt5
    python3-notify2
    Use 'sudo apt autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

    When I tried the oracle-java15-jre that installed with LibreOffice, the result is the same.

    I appreciate that it does work with Linux in general. I even setup a VM with Ubuntu 20.04 (nearest to Linux Mint 20.1 Ulyssa) and that worked fine:

    System:
    (Ubuntu)
    $ inxi -S
    System:
    Host: adaUbuntu Kernel: 5.8.0-38-generic x86_64 bits: 64
    Desktop: Gnome 3.36.4 Distro: Ubuntu 20.04.1 LTS (Focal Fossa)

    (LibreOffice)
    Version: 6.4.6.2
    Build ID: 1:6.4.6-0ubuntu0.20.04.1
    CPU threads: 2; OS: Linux 5.8; UI render: default; VCL: gtk3;
    Locale: en-IE (en_IE.UTF-8); UI-Language: en-US
    Calc: threaded

    (Java)
    ~$ java --version
    openjdk 11.0.9.1 2020-11-04
    OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04)
    OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)

    What isn't working however, isLinux Mint 20.1 Ulyssa:

    ~$ inxi -S
    System:
    Host: TP-P1-Gen-2 Kernel: 5.4.0-65-generic x86_64 bits: 64
    Desktop: Cinnamon 4.8.6 Distro: Linux Mint 20.1 Ulyssa
  • I'm saying to try the downloadable builds from Oracle, not anything that comes from your system package manager.
  • I did, I had tried with a PPA and that is why the Oracle JDK becomes available via apt.

    Just in case I downloaded as you instructed and tried that version in LibreOffice. I added it by selecting "Add" and browsing directly to the Oracle package. It then appeared as: Oracle Corporation 15.0.2

    The same outcome, however.
  • Have you tried a copy of LO downloaded straight from LO, instead of a packaged version?

    You can also try deleting your LO user directory, which frequently fixes .oxt install problems, though usually with a different error.

    Beyond that, you'll need someone from LO to help you.
  • I did, that didn't help. I went for the nuclear option and I have reinstalled Linux Mint 20.1 Ulyssa from scratch.

    $ java --version
    openjdk 11.0.9.1 2020-11-04

    Version: 6.4.6.2
    Build ID: 1:6.4.6-0ubuntu0.20.04.1
    CPU threads: 12; OS: Linux 5.4; UI render: default; VCL: gtk3;
    Locale: en-IE (en_IE.UTF-8); UI-Language: en-US
    Calc: CL

    There must be something that happened in the upgrade process from Mint 20.0 Ulyana that was causing the problem.

    Thanks for your help.
Sign In or Register to comment.