Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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!

share|improve this question

1 Answer 1

Here is how I install 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 by 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 on 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 to point at it.

share|improve this answer
    
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
    
@RPennese, thanks for the link :) –  Pavel A Feb 5 '13 at 12:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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