Libreoffice does not detect Java on fresh install of 12.10: how to make it work?

12,768

Solution 1

I ran into this issue with the latest libreoffice on a production machine. We run this in --headless mode, but should work for a GUI version

LibreOffice 5.1.6.2 10m0(Build:2)

To fix:

sudo apt -y install libreoffice-base

This will install all the requirements for libreoffice including the java-jre

Solution 2

Here is how I installed the latest Oracle Java on my Ubuntu 12.10 (manual way, but works great):

  1. Download the latest tarball of JDK/JRE from http://www.oracle.com/technetwork/java/javase/downloads/index.html
  2. Extract it to /usr/java: tar -xf jre-7u13-linux-x64.tar.gz -C /usr/java
    and create a symlink to the current version for convenience:
    ln -s /usr/java/jre1.7.0_13 /usr/java/latest
  3. Create symlinks so that Firefox can use it:
ln -s /usr/java/latest/lib/amd64/libjavaplugin_jni.so ~/.mozilla/plugins/libjavaplugin_jni.so
ln -s /usr/java/latest/lib/amd64/libnpjp2.so ~/.mozilla/plugins/libnpjp2.so

That's it - all my browsers and LibreOffice recognize and use it.

The primary drawback of this approach is that it is not a package installation, but since all files are kept in just one folder, I guess it is okay. If I want to update Java, all I have to do is untar the new archive to /usr/java and make /usr/java/latest point to it.

Share:
12,768

Related videos on Youtube

R Pennese
Author by

R Pennese

Updated on September 18, 2022

Comments

  • R Pennese
    R Pennese over 1 year

    I can't use some features of Libreoffice (some extensions, macros) because my Java runtime environment (openJdk-6) is not recognized in my system (see [screenshot]

    LibOJava

    When launching LibreOffice from the terminal, I get:

    javaldx: Could not find a Java Runtime Environment! 
    Please ensure that a JVM and the package libreoffice-java-common is installed.
    If it is already installed then try removing ~/.libreoffice/3/user/config  /javasettings_Linux_*.xml
    Warning: failed to read path from javaldx
    Fontconfig warning: "/usr/lib/libreoffice/share/fonts/truetype/fc_local.conf", line 13: Having multiple <family> in <alias> isn't supported and may not works as expected
    

    There is a bug reported about this but the workaround suggested does not work for me (install libreoffice-base) and is additionally tagged as "won't Fix": https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/926594

    I tried deleting the file mentioned in the error message and re-installing both LibreOffice and openjdk-6 but to no avail... I suppose I could manually add a runtime environment from the LibreOffice Menu Options > Libreoffice > Java but I don't know which directory to choose.

    Please help!

  • R Pennese
    R Pennese about 11 years
    Thanks Pavel! I found a ppa that is maintained and contains scripts that do just that: launchpad.net/~webupd8team/+archive/java . For some reason now Libreoffice detects the Oracle JRE...I Would have liked to use openjdk though and I am surprized it could not work on a new system
  • Arpad Horvath
    Arpad Horvath over 6 years
    It works with Ubuntu 16.04 LTS.
  • Nicolas Hanna
    Nicolas Hanna about 5 years
    Worked on Ubuntu 18.04.2 LTS
  • Adan Rehtla
    Adan Rehtla about 4 years
    Could you please select this as the accepted answer?
  • Mat D.
    Mat D. about 2 years
    worked on Ubuntu 21.10