Bug 559703 - Broken: warning "There are no JREs installed in the workspace that are strictly compatible with this environment"
Summary: Broken: warning "There are no JREs installed in the workspace that are strict...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.15   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 4.15 M3   Edit
Assignee: Vikas Chandra CLA
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2020-01-30 06:00 EST by Dani Megert CLA
Modified: 2020-02-19 05:30 EST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2020-01-30 06:00:17 EST
Broken since 4.13.

1. Start new workspace with Java 11
2. Create a Java project where you set the execution environment to JavaSE-1.8
==> expected warning is not shown

The EE preference page correctly shows that the JRE is not strictly compatible.


Most likely caused by fix for bug 548218.
Comment 1 Stephan Herrmann CLA 2020-01-30 06:16:45 EST
For clarification: 
- in your case do you use --release?
- where do you expect a warning?
  - in the new project wizard?
  - in the compiler properties page?
  - in the Problems view?
Comment 2 Dani Megert CLA 2020-01-30 10:07:32 EST
(In reply to Stephan Herrmann from comment #1)
> For clarification: 
> - in your case do you use --release?
I use exactly the provided steps. By default --release is disabled.

> - where do you expect a warning?
>   - in the new project wizard?
>   - in the compiler properties page?
>   - in the Problems view?
The warning is expected on the project and hence also in the problems view.

You can try 4.12 to see how it must work.
Comment 3 Sarika Sinha CLA 2020-01-31 01:16:58 EST
I am able to reproduce the issue.

org.eclipse.jdt.internal.launching.EECompilationParticipant.isReleaseFlagEnabled(String, String, IJavaProject) -> 
String releaseVal = project.getOption(JavaCore.COMPILER_RELEASE, true);

Returns enabled even if the the --release option is not set in the UI.
Comment 4 Sarika Sinha CLA 2020-02-02 23:27:59 EST
Adding Manoj and Jay!
Comment 5 Sarika Sinha CLA 2020-02-14 00:47:53 EST
Vikas has agreed to take a look from Core perspective. 
Thanks Vikas!
Comment 6 Eclipse Genie CLA 2020-02-14 06:36:13 EST
New Gerrit change created: https://git.eclipse.org/r/157713
Comment 8 Sarika Sinha CLA 2020-02-15 01:59:26 EST
Thanks Vikas and Kalyan!

Issue: There is no default value for release option for Java 8 and below so JDT core looks upward and finds --release set at Workspace level as the workspace was launched with Java 11.

Profile from OSGI does not have Release property, Launching adds this property as "Disabled" so that JDT Core does not look up in the chain.
Comment 9 Dani Megert CLA 2020-02-16 12:59:09 EST
Verified with eclipse-SDK-I20200215-1800-win32-x86_64.
Comment 10 Dani Megert CLA 2020-02-19 05:16:42 EST Comment hidden (obsolete)
Comment 11 Dani Megert CLA 2020-02-19 05:29:51 EST
(In reply to Dani Megert from comment #10)
My bad. With Java 13 we create the project with enabled --release option. Hence no warning needs to be issued.

Marked comment 10 as obsolete.