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



Question:

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!


Solution:1

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.


Solution:2

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


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »