Sunday, February 10, 2008

OpenOffice.org / Java Problem

I tried exporting a spreadsheet to XHTML in OpenOffice.org Calc. About 30% into the process, according to the progress bar, oocalc informed me that there's a problem with the Java installation on my machine. It instructed me to select an operational Java runtime environment in Tools->Options->OpenOffice.org->Java. I did. It didn't help.

But it used to work. It did work just a week ago. I installed Sun JRE 6 an hour before that, trying to get a Java applet on a certain website working (to no avail). So I assumed it caused my troubles. But removing it had no effect.

I launched oocalc from a terminal window, hoping to see error messages, and actually got one:

javaldx failed

This seemed relevant, but quite meaningless. I searched around for this phrase, and got quite a few hits, the first of which was the source code for javaldx.cxx at the OpenOffice.org Cross-Reference. Simply put - OpenOffice.org never found the JRE.

I went through ~/.xsession-errors and found the following message:
[Java framework]sunjavaplugin.so could not load Java runtime library:
file:///usr/lib/jvm/java-1.5.0-sun-1.5.0.13/jre/lib/i386/client/libjvm.so
which made sense - there's no such file, and the version installed is 1.5.0.14. So why is OO looking for an older version?

I looked at /var/log/apt/term.log and realized that both OO and Java5 were upgraded a few days ago. Aha. Ahhem. Err, what do I do now?

Maybe this is some local configuration issue - in my user account?

Turns out it's my lucky(?) day. I found the above mentioned file path in ~/.openoffice.org2/user/config/javasettings_Linux_x86.xml, so I moved the file away, and fired up oocalc, hoping it won't just crash. It didn't. It actually worked.

Sometimes I wish I didn't upgrade that often. I'm probably addicted to the pain - I have no other explanation. Fact is I'm feeling high now. I need some Java. I need some sleep.

4 comments:

  1. Thanks a lot. It helped to fix the issue I was having with some plugins.

    ReplyDelete
  2. Thank you, too :)

    Very beautiful path to solving the mystery, and I learned to have a look into .xsession-errors in the future as well, thank you even more for that one.

    ReplyDelete
  3. Aaaaaaaaaaaaaaaaaaah ! After two hours, I finally find your post : thanks a lot !!!!

    ReplyDelete
  4. thanks.
    I looked in /etc, and dismissed the thought that it can be in ~/.
    It should rather reference a generic jvm location like /usr/lib/jvm/java-6-sun/jre , so you don't need to change it every update.

    ReplyDelete