Page 1 of 1

[Solved] JRE not found (Java 8)

Posted: Wed Oct 19, 2016 8:42 pm
by ooquestion
I upgraded Java to Java 8. I upgraded OO to 4.1.3 (AOO413m1(Build:9783) - Rev. 1761381
Since then anytime I enter " = " to start typing a formula in Calc OO crashes with the following message:
"OpenOffice requires a Java runtime environment (JRE) to perform this task. The selected JRE is defective. Please select another version or install a new JRE and select it under Tools - Options - OpenOffice - Java."
then
" Could not create a JRE implementation loader" (fatal error)
then
OO closes entirely.

So,
1) I tried to get OO to recognize JRE but OO doesn't see my installed JRE (no version listed under "Java runtime environment already installed".
2) I then click on "Add" to find the path in C/ under which Java is installed but OO responds with "The folder you selected does not contain a JRE... Pls select a different folder". I am POSITIVE that I am pointing to the right folder - I see it in Windows Explorer.
3) I uninstalled Java 8 and reinstalled. Reboots in between.

Anyone knows why OO4.1.3 doesn't "see" java.exe in the folder I point it to???

Moral of the story: never update your software - old is good!

Re: JRE not found (Java 8)

Posted: Wed Oct 19, 2016 8:44 pm
by RoryOF
OO 4.1.3 is a 32 bit application and needs a 32 bit Java, which you must download and install; then select it in /Tools /Options /OpenOffice /Java.

Re: JRE not found (Java 8)

Posted: Wed Oct 19, 2016 9:01 pm
by ooquestion
I am running Java 8 32-bit.
The question is exactly that: how do I select it in /Tools /Options /OpenOffice /Java ?

Re: JRE not found (Java 8)

Posted: Wed Oct 19, 2016 9:18 pm
by RoryOF
The folder you point to should be jre8. Don't actually point to java,exe

Re: JRE not found (Java 8)

Posted: Wed Oct 19, 2016 9:33 pm
by ooquestion
Rory - the folder jre8 does not contain java.exe. The subfolder \bin is the correct one.
I am pointing to C:\Program Files\Java\jre1.8.0_111\bin

(I also tried pointing to \jre1.8.0_111 (one up from \bin) as your post alludes to - but it doesn't work either and OO says "The folder you selected does not contain a JRE... Pls select a different folder"

Re: JRE not found (Java 8)

Posted: Wed Oct 19, 2016 9:43 pm
by Villeroy
ooquestion wrote:Rory - the folder jre8 does not contain java.exe. The subfolder \bin is the correct one.
I am pointing to C:\Program Files\Java\jre1.8.0_111\bin

(I also tried pointing to \jre1.8.0_111 (one up from \bin) as your post alludes to - but it doesn't work either and OO says "The folder you selected does not contain a JRE... Pls select a different folder"
If you ran a 32-bit system that would be the right path. On a 64-bit system you would need another Java installation in "C:\Program Files (x86)\" where the 32-bit programs (such as OpenOffice) are installed. There is nothing wrong with having as many jre versions as needed to run all your Java software. OpenOffice is not Java software but parts of it may interface with Java components so the bitness is crucial.
https://libreoffice.org/ for WIndows exists in two versions.

Re: JRE not found (Java 8)

Posted: Wed Oct 19, 2016 9:46 pm
by RoryOF
On my little used Windows system the java path is c:/Program Files/Java/jre7. jre7 contains bin and lib and a few text files.

Re: JRE not found (Java 8)

Posted: Thu Oct 20, 2016 12:28 am
by Bill
This may be a bug in AOO 4.1.3. I had AOO 4.1.2, Java Update 101 and Java Update 111 installed on Windows 10. Both Java updates appeared in the list of installed Java runtime environments in Java Options in AOO 4.1.2. After upgrading to AOO 4.1.3, the option to use a Java Runtime environment became unchecked and neither update appeared in the list. Clicking the Add button and selecting the folder C:\Program Files (x86)\Java returned the message that "The folder you selected does not contain a Java runtime environment". I have never seen this problem before on any previous version of AOO. AOO usually finds the installed 32-bit Java runtime environments within a few seconds after clicking the option to use a Java runtime environment.

Has anyone else checked the Java Options after upgrading to AOO 4.1.3 on Windows?

Re: JRE not found (Java 8)

Posted: Thu Oct 20, 2016 12:51 am
by Villeroy
Oh, I remember something like this with LibreOffice. It was related to the 3 digits in the minor version number when jre 8_101 came out. It could be fixed quickly in LO.

Re: JRE not found (Java 8)

Posted: Thu Oct 20, 2016 5:32 am
by ooquestion
Bill - you're spot on. That's exactly the problem.

Any OO developer on this forum to pitch-in?

I guess my work-around is to downgrade OO (I have some old install files)...

Re: JRE not found (Java 8)

Posted: Thu Oct 20, 2016 2:00 pm
by Villeroy
I would install a second downgraded Java only for the office suite. It is extremely unlikely that the known security flaws have anything to do with the office suite. The security flaws are related to sandboxing in browser applets and network intrusion.
I suspect that the bug is in all versions of OpenOffice without coming to the surface because the minor version numbers of Java had 2 digits.

Re: JRE not found (Java 8)

Posted: Fri Oct 21, 2016 6:14 am
by ooquestion
Since Oracle, in its great wisdom, doesn't provide prior versions of Java (except for developers with an Oracle account) I'll have to wait for the next Java version with only 2 digits in the version number...

Re: JRE not found (Java 8)

Posted: Fri Oct 21, 2016 12:25 pm
by Villeroy
ooquestion wrote:Since Oracle, in its great wisdom, doesn't provide prior versions of Java (except for developers with an Oracle account) I'll have to wait for the next Java version with only 2 digits in the version number...
I see. Can you tell us if an older version of AOO does work with a the latest JRE?

Re: JRE not found (Java 8)

Posted: Fri Oct 21, 2016 6:57 pm
by Bill
AOO 4.1.2 had no problem with 3 digits in the Java update version number. I've submitted a bug report:

Issue 127176 - Java not recognized after update to AOO 4.1.3

Re: JRE not found (Java 8)

Posted: Tue Oct 25, 2016 9:08 pm
by Bill
The problem is caused by a 64-bit version of msvcr100.dll installed by AOO 4.1.3 in C:\Program Files (x86)\OpenOffice 4\program instead of the 32-bit version. Systems that don't have the 32-bit version already installed won't be able to find the Java Runtime Environments. To work around it, go to Microsoft Visual C++ 2010 Service Pack 1 Redistributable Package MFC Security Update . Click the download button, select the vcredist_x86.exe file and download it. Run the downloaded file to install it. This will install the 32-bit version of msvcr100.dll system wide and AOO 4.1.3 should be able to find and use it.

Re: JRE not found (Java 8)

Posted: Thu Oct 27, 2016 11:52 pm
by Alex1
I still have version 4.1.2 on another computer and copied msvcr100.dll from it to 4.1.3 on a 32-bit computer as Bill described in comment 11 of https://bz.apache.org/ooo/show_bug.cgi?id=127176 and it does help.

Re: JRE not found (Java 8)

Posted: Fri Oct 28, 2016 1:04 am
by Greengiant224
Do any of these links to previous Java problems not outline how to fix them?

Many as far back as 2013.

viewtopic.php?f=15&t=75274#p341920

viewtopic.php?f=15&t=76152#p346584

viewtopic.php?f=13&t=71546#p321715

viewtopic.php?f=15&t=60221#p267331

viewtopic.php?f=15&t=67820#p302079

viewtopic.php?f=15&t=66642#p296473

viewtopic.php?f=15&t=62760#p278069

viewtopic.php?f=15&t=61181#p270904

Addendum:
Win 7 64bit, AOO v 3.4.1 alongside LO v4&5 AOO 4.1.3 and several portable versions
ALL utilising one installation of Java v1.8.0.111 (32bit) - Never had any problems. :bravo:

Greengiant224

Re: JRE not found (Java 8)

Posted: Fri Oct 28, 2016 2:26 pm
by Villeroy
Bill wrote:The problem is caused by a 64-bit version of msvcr100.dll installed by AOO 4.1.3 in C:\Program Files (x86)\OpenOffice 4\program instead of the 32-bit version.
Do we have an issue number for this? Does it affect all installations of AOO 4.1.3 on x86? I'm afraid, I still do not understand this Windows specific problem. When it came up in the past, I assumed that it was a problem with an outdated msvcr compared to a new JRE. This is the first time I read that AOO installs a 64-bit version instead of 32-bit.

Re: JRE not found (Java 8)

Posted: Fri Oct 28, 2016 7:13 pm
by Bill
Greengiant224 wrote:Do any of these links to previous Java problems not outline how to fix them?

Many as far back as 2013.

viewtopic.php?f=15&t=75274#p341920

viewtopic.php?f=15&t=76152#p346584

viewtopic.php?f=13&t=71546#p321715

viewtopic.php?f=15&t=60221#p267331

viewtopic.php?f=15&t=67820#p302079

viewtopic.php?f=15&t=66642#p296473

viewtopic.php?f=15&t=62760#p278069

viewtopic.php?f=15&t=61181#p270904

Addendum:
Win 7 64bit, AOO v 3.4.1 alongside LO v4&5 AOO 4.1.3 and several portable versions
ALL utilising one installation of Java v1.8.0.111 (32bit) - Never had any problems. :bravo:

Greengiant224
It's the same solution, but for a different problem. Loading the Java 8 Runtime Environment from AOO 3.4.1 on Vista or Windows 7 required the 32-bit msvcr100.dll which was not included with AOO 3.4.1. Installing the MS Visual C++ Redistributable installed the msvcr100.dll file. Starting with AOO 4.0.0 or 4.0.1, the 32-bit msvcr100.dll file was included with AOO. In AOO 4.1.3, msvcr100.dll was updated, but the updated file was 64-bit instead of 32-bit. Since 32-bit applications can't load 64-bit DLLs, it's now necessary to replace the file manually or install the MS Visual C++ Redistributable on systems which don't have the 32-bit msvcr100.dll file installed.

Re: JRE not found (Java 8)

Posted: Fri Oct 28, 2016 8:50 pm
by Bill
Villeroy wrote:
Bill wrote:The problem is caused by a 64-bit version of msvcr100.dll installed by AOO 4.1.3 in C:\Program Files (x86)\OpenOffice 4\program instead of the 32-bit version.
Do we have an issue number for this? Does it affect all installations of AOO 4.1.3 on x86? I'm afraid, I still do not understand this Windows specific problem. When it came up in the past, I assumed that it was a problem with an outdated msvcr compared to a new JRE. This is the first time I read that AOO installs a 64-bit version instead of 32-bit.
It shouldn't affect systems that have the MS Visual C++ Redistributable installed. If the msvcr100.dll file found in AOO can't be loaded, Windows will search for it in C:\Windows\System32 (32-bit systems) or C:\Windows\SysWOW64 (64-bit systems). That's why installing the MS Visual C++ Redistributable will work around the problem and may be one reason why there haven't been very many reports of the problem.

https://bz.apache.org/ooo/show_bug.cgi?id=127176

There's now another discussion about how the msvcr100.dll file should be bundled or even if it should be bundled:
https://bz.apache.org/ooo/show_bug.cgi?id=127197

Re: JRE not found (Java 8)

Posted: Tue Nov 22, 2016 2:22 am
by ooquestion
Thanks Bill. Your solution worked.

Although I wonder why AOO would require a "patch" from evil-ish-MSFT to work... Hopefully future releases won't have this problem.

Thanks.