2

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!

7

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

  • 1
    It works with Ubuntu 16.04 LTS. – Arpad Horvath Aug 30 '17 at 16:18
  • 1
    Works with Ubuntu 18.04 LTS as well, thanks! – Kostas Siabanis Jul 23 '18 at 7:52
  • 1
    Worked on Ubuntu 18.04.2 LTS – Nicolas Hanna Apr 8 at 0:35
3

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.

  • 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 – R Pennese Feb 5 '13 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.