Closed howlger closed 1 month ago
Running with JavaSE-23 EE is supported as this mandates the EE one wants to run with but it doesn't mandate that the bytecode generated from the project should be at level 23. E.g. I can require using JavaSE-23 EE as my project uses new APIs in Java 23 despite the fact that the project will be compiled to Java 22(or older). What am I missing here?
What am I missing here?
It is not about running but about compilation level. After this wizard is done, we allow & set Java 23 in compiler preferences for the project but generate and support only Java 22. So user assumes he can use Java 23 JLS but he can't actually.
None of them seems to allow setting 23
None of them seems to allow setting 23
But the actual compiler options file has 23!
Now I understand the issue.
The Java compiler setting Use compliance from execution environment 'JavaSE-23' on the 'Java Build Path' does not do what it says, or at least what a user would expect. From the user's point of view the differences between JavaSE-22
and JavaSE-23
are not shown in the Package/Project Explorer, nor in the Java compiler setting (a user will not look at greyed-out/disabled fields).
@iloveeclipse What do you think of the approach taken in https://github.com/akurtakov/eclipse.jdt.ui/commit/7a2ac1b9b2010b2a76052c42dec676749a5d5716 ? If this looks fine as idea I'll finish it. Btw, is there any public API to achieve the same as CompilerOptions.getLatestVersion() ?
What do you think of the approach taken in akurtakov@7a2ac1b ? If this looks fine as idea I'll finish it. Btw, is there any public API to achieve the same as CompilerOptions.getLatestVersion() ?
See my ideas / comments on https://github.com/eclipse-jdt/eclipse.jdt.core/pull/2606
I don't see this directly benefiting the use case here (EE version that the compiler doesn't know about yet) but I will wait for the API changes to shape up before looking further into this one to reduce cross-fire.
I don't see this directly benefiting the use case here (EE version that the compiler doesn't know about yet)
Exact this use case could be avoided with new API, so Java 23 EE would not appear as allowed EE because there is no compiler support for that.
but I will wait for the API changes to shape up before looking further into this one to reduce cross-fire.
See changes on
For this ticket, the only additional change would be to restrict JavaCore.SUPPORTED_VERSIONS
to exclude versions past CompilerOptions.getLatestVersion()
.
Closed: in the Eclipse SDK 4.33RC2, in the New Java Project dialog, in the Use an execution environment JRE drop-down menu, JavaSE-23
is no longer offered as an option.
In the Eclipse SDK 4.32, in the New Java Project dialog, in the Use an execution environment JRE drop-down menu,
JavaSE-23
is offered as an option, although it is not yet supported.See also: https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/1349#issuecomment-2144428116