How to fix OpenOffice.org requires JRE error on Ubuntu 8.04

I have the latest Java Runtime Environment installed but this error always comes up when I'm trying to export my writer document to html/xhtml.

OpenOffice.org JRE error

When I open Tools -> Options -> Java, I didn't find any JRE which is supposed to be detected by OpenOffice.org. I tried to figure out whats missing with my OpenOffice.org and after installing openoffice.org-writer2latex, I finally get OpenOffice.org export to html/xhtml working.
To fix this problem just open Applications -> Accessories -> Terminal and type:

apt-get install openoffice.org-writer2latex

After you install the openoffice.org-writer2latex package, open Tools -> Options -> Java.
Verify if OpenOffice.org detects your Java Runtime Environments.

OpenOffice.org JRE