Can't find Java JRE Windows 10

I have LibreOfice 7.1.3.2, 64 Bit installed on a Windows 10 box. It is unable to find the Java JRE even though I have 2 of them installed. WHen I click on Tools | Options | Advance, and Click on the Add button and browse directly to the folder where the JRE is installed, it comes back and says the folder I selected does not contain a Java Runtime environment. But it does and the folder is in the path statement:

c:\Program Files\Java\jdk-12.0.2\bin>java -version
java version “12.0.2” 2019-07-16
Java™ SE Runtime Environment (build 12.0.2+10)
Java HotSpot™ 64-Bit Server VM (build 12.0.2+10, mixed mode, sharing)

So, what exactly is LO looking for as a java runtime?

You need JRE 8.0 64 bit to match your 64 bit installation of LibreOffice. You can download it from https://java.com/en/download/ . Once installed in default location, LO should find it automatically

I don’t think that JDK is JRE. Cheers, Al

You need JRE 8.0

Why? We aren’t limited to 8.0.

I don’t think that JDK is JRE.

Of course it’s not. It’s a superset. So JDK includes JRE. And we even require JDK on macOS.

Java 8 Update 291 is all I get offered when I go to download page. I stand corrected on the JDK.

@EarnestAl: as described on our FAQ, we also can use third-party JRE vendors in addition to Oracle. In part, that was accelerated by the Oracle’s changed policy :slight_smile:

And the specific version reported by OP is at Archived OpenJDK GA Releases.

@jeff_steinkamp: just tested that simply unpacking jdk-12.0.2 (downloaded from https://download.java.net/java/GA/jdk12.0.2/e482c34c86bd4bf8b56c0b35558996b9/10/GPL/openjdk-12.0.2_windows-x64_bin.zip) into my C:\jdk-12.0.2, and adding C:\jdk-12.0.2\bin to installed JREs in options, works here with Version: 7.1.3.2 (x64) / LibreOffice Community
Build ID: 47f78053abe362b9384784d31a6e56f8511eb1c1
CPU threads: 12; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL

I have tested that this extension (that relies on Java) works. However, I don’t know if other Java instances present on my system could affect my results (e.g., modifying PATH or registry).

I just tried that and it tells me there is no JRE available when I know for a fact all the files are there. So I guess the question is, what exactly is LO actually looking for to determine if a JRE exists in a folder.

So I guess the question is, what exactly is LO actually looking for to determine if a JRE exists in a folder.

The detection is performed by jfw_getJavaInfoByPath function, which calls jfw_plugin_getJavaInfoByPath, and the latter calls getJREInfoByPath. The latter has all the logic: checks that a correct directory path is passed; checks if it’s one of already registered paths; uses list of known vendors to find related EXE paths (e.g., for Windows, that’s java.exe, bin/java.exe, or jre/bin/java.exe); loops through the paths, adding them to passed directory, executes it with JREProperties argument…

The JREProperties refers to C:\Program Files\LibreOffice\program\JREProperties.class (source). Then if the process was executed, the output is parsed, and the EXE location is stored. After that the JRE is initialized (depending on vendor, it may be different, with fallback to standard SunInfo initialization).

That’s basically all. You may even try to debug your problem, if you build a debug version of LibreOffice.

@mikekaganski,

Tried your unzip of openJDK and itworked with Base:

Version: 7.1.2.2 (x64) / LibreOffice Community
Build ID: 8a45595d069ef5570103caea1b71cc9d82b2aae4
CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

Did have an older version of openJDK(10.x) installed (unselected for test) but otherwise my Win 10 is fairly clean.

Base file used HSQLDB and Report builder (created new report) both of which require Java.

@mikekaganski
The path is C:\Program Files\Java\jdk-12.0.2\bin\java.exe, yet it does find version 1.8 at C:\Program Files\Java\jre1.8.0_291\bin\java.exe

@jeff_steinkamp: what can I say. As I wrote, this works for me; and I see that in my case, the result of java -version is a bit different:

openjdk version "12.0.2" 2019-07-16
OpenJDK Runtime Environment (build 12.0.2+10)
OpenJDK 64-Bit Server VM (build 12.0.2+10, mixed mode, sharing)

Maybe the difference is relevant; maybe the location, or maybe locale … no idea. I tried to answer your “what exactly is LO actually looking for to determine if a JRE exists in a folder”. Without a way to repro myself, there’s nothing more I could do.