Bug 103570 - Java not selected automatically when a database is opened for the first time
Summary: Java not selected automatically when a database is opened for the first time
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
5.2.0.4 release
Hardware: All All
: low trivial
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks: Java-Runtime-JRE
  Show dependency treegraph
 
Reported: 2016-10-29 07:34 UTC by Aron Budea
Modified: 2021-04-04 04:11 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2016-10-29 07:34:20 UTC
This is a separate bug report for the behavior described in:
https://bugs.documentfoundation.org/show_bug.cgi?id=103507#c12

The following behavior happens with versions 5.2.0.4 or 5.2.2.2 or 5.3 alpha1 and Java 8u92, or with 5.2.3.3 and Java 8u112 (there's a different error with earlier versions and Java 8u112 because of bug 103507) in Windows 7.
Does not happen with 5.1.5.2 and Java 8u92. => regression

1. Start with a clean profile.
2. Switch to Tables view.

The following error is shown:
"LibreOffice 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 - LibreOffice - Advanced."
(then another that connection to the data source could not be established)

3. Restart Base, open database, switch to Tables again.

There are no errors anymore, so the error on first run is a bug.


Debugging revealed that for this Java version (8u92) on the first attempt jfw_startVM(...) call returns with JFW_E_VM_CREATION_FAILED:
http://opengrok.libreoffice.org/xref/core/stoc/source/javavm/javavm.cxx#758
(this was done before bug 103507 was fixed)

Since the issue doesn't occur in 5.1, it's a regression, and can be bibisected, but only with Java 8u92 (or likely with anything <= u99)
I haven't tried if it occurs in Linux.
Comment 1 Julien Nabet 2016-10-29 12:33:59 UTC
Stephan: thought this Java detection problem may be interest you?
Comment 2 Buovjaga 2016-11-16 09:49:18 UTC
I installed 5.2.3 and deleted my profile. I did not get the error.

Were you using 32 or 64-bit version?

My Java is (build 1.8.0_111-b14), it does not offer a further update to 112.

Win 7 Pro 64-bit, Version: 5.2.3.3 (x64)
Build ID: d54a8868f08a7b39642414cf2c8ef2f228f780cf
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
Locale: fi-FI (fi_FI); Calc: CL
Comment 3 Aron Budea 2016-11-16 15:44:38 UTC
After more testing, it doesn't happen reliably, maybe ~33-50% of the time.

Using 32-bit LO and Java. Java 8u111 and 8u112 are essentially the same, the update ending with 1 only contains security fixes, while the other has additional features (no idea what those are).
Comment 4 Xisco Faulí 2017-08-17 16:28:49 UTC
Hi Aron,
is this issue still happening in master? I recall Samuel doing some changes in this area...
Comment 5 Aron Budea 2017-08-17 22:07:44 UTC
Hi Xisco, yes, I just reproduced with daily build 2017-08-15_01:59:49 / bebaac5eb6ebd2db3e1ea22b1630111343a9c25c.
Comment 6 Alex Thurgood 2017-08-18 14:51:55 UTC
FWIW, I can also confirm with master OSX
Comment 7 Alex Thurgood 2017-08-18 14:52:57 UTC
I see the list of available JDKs, but none are selected by default when I first open the Advanced dialog under Preferences.
Comment 8 Buovjaga 2018-05-24 17:01:42 UTC
Tried 10 times with 5.2.5.0 and a clean profile, Win 10, Java 1.8.0_161, but could not reproduce.
Comment 9 Aron Budea 2021-03-13 22:44:49 UTC
My current experience is that with a clean profile:
- on Linux a JRE is automatically selected when I open Tools -> Options; LibreOffice -> Advanced,
- on Windows no JRE is automatically selected.

However, in both cases if I try to reproduce the issue by opening a database, and navigating to Tables view, or even opening a table, it works fine, and if I visit Options then, even on Windows a JRE is selected.
Comment 10 Stephan Bergmann 2021-03-15 08:54:31 UTC
(In reply to Aron Budea from comment #9)
> My current experience is that with a clean profile:
> - on Linux a JRE is automatically selected when I open Tools -> Options;
> LibreOffice -> Advanced,
> - on Windows no JRE is automatically selected.

(That difference between Linux and Windows is presumably because on Linux the soffice script calls the javaldx helper executable early on, which tries to select a JRE if none has been selected yet.)