Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eclipse 4.32 offers the execution environment JavaSE-23, although it is not yet supported #1448

Closed
howlger opened this issue Jun 11, 2024 · 11 comments

Comments

@howlger
Copy link
Contributor

howlger commented Jun 11, 2024

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: #1349 (comment)

@akurtakov
Copy link
Contributor

akurtakov commented Jun 11, 2024

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?

@iloveeclipse
Copy link
Member

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.

@akurtakov
Copy link
Contributor

akurtakov commented Jun 11, 2024

image
Screenshot from 2024-06-11 12-02-04

None of them seems to allow setting 23

@iloveeclipse
Copy link
Member

None of them seems to allow setting 23

But the actual compiler options file has 23!

@akurtakov
Copy link
Contributor

Now I understand the issue.

@howlger
Copy link
Contributor Author

howlger commented Jun 11, 2024

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).

@akurtakov
Copy link
Contributor

@iloveeclipse 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() ?

@iloveeclipse
Copy link
Member

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 eclipse-jdt/eclipse.jdt.core#2606

@akurtakov
Copy link
Contributor

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.

@iloveeclipse
Copy link
Member

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().

akurtakov added a commit to akurtakov/eclipse.jdt.ui that referenced this issue Jun 27, 2024
@howlger
Copy link
Contributor Author

howlger commented Aug 30, 2024

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.

@howlger howlger closed this as completed Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants