Community
Participate
Working Groups
When --enable-preview is enabled in the workspace setting, then this setting is applied to new projects even if the project enables project specific settings and the compiler version is does not support --enable-preview How to reproduce [Preconditions] [P1] newly created workspace [Actions] [A1] Start Eclipse [A2] Open Preferences->Java->Compiler [A3] Switch Compiler compliance level to 12 and check --enable-preview. [A4] Hit "Apply and close" of the Preferences Dialog [A5] Create a Java project with JRE 1.8 and a main class [A6] Run the Java project [Observed] [O1] (OK) Eclipse starts [O2] (OK) Settings for the java compiler are displayed [O3] (OK) - [O4] (OK) Preferences Dialog closes [O5] (OK) Project is created [O6] (NOK) The projects fails to run. an error message is displayed that --enable-preview is an invalid compiler option [Expected] [E6] The Project runs normaly [Heal] [H1] Open the project Properties [H2] go to Java Compiler [H3] Un-check the setting "Use compliance from execution environment 1.8..." [H5] Check the setting "Use compliance from execution environment 1.8..." [H6] Hit Apply [H7] Do A6 Issues - The Compiler setting of the project uses its own settings and not Workspace settings. Still the some Workspace settings - The project compiler setting tell the user that 1.8 compliance is used. --enable-preview is not compliant. - Eclipse should always use the compiler settings the user has set. This is not the case here. Note - Video of the issue: https://youtu.be/h7tJ4YYl6wU - Deleting .eclipse did not help Environment Windows 10 Eclipse Version: 2019-09 R (4.13.0) Eclipse Build id: 20190917-1200
Retested with Eclipse 2019-12 Now an error marker/annotation is displayed that hints the error. This is Better now because the user now sees the issue before hitting run. Still i think the situation could be improved. If a setting is invalid for a project, the setting should be ignored for the project.
Retested with 2021-03 (4.13). Issue is unchanged.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.