-
Notifications
You must be signed in to change notification settings - Fork 321
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
Java 21 Masterplan #2686
Comments
Guice and Guava is now on latest. we will see if this is sufficient |
As Java 21 has been released today, do you have any roadmap when to support it? Especially solving the jdt issue mentioned in #2680 is something we are looking forward to. |
There is no road map and as Xtext is no longer my day job it might take long. First question: are Java 21 capable eclipse platform and jdt maven artifacts already available or will they ship in December ? |
Hmm, this issue is "open", no new comments for months. |
with https://www.eclipse.org/lists/eclipse-dev/msg12207.html we wont have maven artifacts before end of year. |
Hi, is there any update on this plan? I guess that errors like I am asking because this is preventing Protelis from becoming Java 21 compliant which, in turn, also prevents Java 21 compliance for the Alchemist Simulator. |
No jdt java 21 maven artifacts no java 21 in Xtext |
Besides that: when these become available this is a help wanted story |
Has there been any progress on this? We make excessive use of generators in our daily builds and are looking to move to Java 21 in the very near future. |
Obviously no. And Xtext is no longer my day job. And nobody seems to step in |
Not sure why "obviously" was needed, as its been 4+ months so we were just looking for any feedback. Are we saying xtext is no longer being officially maintained? If there is no roadmap for Java 21+, those of us that heavily rely on xtext will have to make plans to move away from the tool. |
I don’t think I alone can do this in my spare time while working at a startup maybe you want to step in and contribute |
I completely understand the lack of time due to other commitments. We will need to react accordingly. |
This doesn't mean that Xtext is no longer officially maintained (see the number of commits in the last few months). However, IIRC, if you don't use records from within xtend you shouldn't have problems switching to Java 21, or am I missing something? |
When I switch to Java 21 from 17, I start getting "cannot resolve proxy: java:/objects/java.lang.string#java.lang.string" errors. No other changes to the code other than changing the version of Java. |
The old jdt dependencies and the Java version Enum don’t support Java 21 @gmlongo1 which usecase are you executing maven gradle eclipse tycho ant ? |
@LorenzoBettini nope, Xtext is failing with Java 21. It does not build with Java 21 (see: Protelis/Protelis-Parser#345), and code produced with previous Java versions fails at runtime when running Java 21, see: https://scans.gradle.com/s/l4r2lg34vs5cu
|
Can you provide a full Stack-Trace for that? |
The old jdt dependencies are the maven ones, right? Because in the TP we already use the latest ones, don't we? |
Yes the maven ones . In the target it depends in which and what you select in the wizard |
@HannesWell Here's how to reproduce:
It should "fail correctly" with any major OS and regardless of the JVM you use to run Gradle. |
…text/xtext#2686 and the general problem of Xtext not updating its dependencies frequently
Sorry I oversaw that, but looking at it now I fail to see the root cause. I haven't checked-out your project, but I run all our xbase-based DSL with Java-21 as well as my developer eclipse (also executed mwe workflows) and didn't notice any issues with it. The only thing I noticed so far(there might be more not yet uncovered) is that the |
as elaborated before
|
@HannesWell I fixed it by constraining the ASM version manually like this: Protelis/Protelis@c78854f |
I would like to clarify that neither the annotations or guice inject are bad. I was just analysing the places where annotations were made use and was there some direct references to javax.inject. sorry if i have confused you on this. @cdietrich |
@shankar-itemis thank's for the analysis and for sharing the code. The gained information is unfortunately not providing any actionable insights, since annotations are commonly used in Xtext and processing all of them in an untargeted fashion is not helpful. |
As noted here #2823 (comment) at least from Eclipse with JDT access to Java 21 records seems to work out of the box from Xtend. I tested it manually. @szarnekow any hint on how to place a test in some of the existing test projects? Then, I guess we need to adapt the standalone part, including the upgrade of JDT in the BOM. To test that, would it be enough to use the tests in our maven plugin projects? Or are there better places to test that? Such experiments are in my fork https://github.com/LorenzoBettini/xtext/tree/lb_java_21-2 While #2986 could already be merged |
I'd guard the test with a check that we have a Java21 available. |
@szarnekow OK, but does something like this LorenzoBettini@3059e10 make sense, or is it useless? |
I think it does make sense, but we should also have a test that uses a Java record from Xbase (can be an Xtend integration test). |
@szarnekow yes, I just wanted to start from the bottom and then up ;) |
Some nice updates:
The next step would be to update our dev BOM with the new JDT code. This will require Java 17 as the minimal version, unless we set the profile in the BOM switching the JDT version according to the current Java, as I had experimented here https://github.com/LorenzoBettini/maven-bom-profiles-example |
If by any means possible, I’d like to have Xtext 2.35 released with Java 11 bytecode. If that contradicts the ability to consume Java 21 bytecode, that would be very sad. |
@szarnekow there's no need to switch to Java 17 as requirement, and we can still ship Java 11, if we want to. My experiments are meant to be sure we can consume Java 21 stuff (if we can consume records we should be safe in that respect). Mostly, there are tests in my fork's branch. In Eclipse, as long as one uses the latest JDT there's no problem accessing Java records. Concerning Maven, if we don't want to update the BOM, it is enough to document to add the more recent JDT as explicit dependencies LorenzoBettini@21b24ac#diff-88e2b37f635d0790f54a2d314a7b4cb75652b846440f6d878a709a5a7910baadR55 if one want to access Java records. To make Maven users easier, we could use the profile "trick" in the BOM I mentioned above. In my experiment, I switch to an older version of JDT when the current JDK is not Java 17 https://github.com/LorenzoBettini/maven-bom-profiles-example/blob/master/bom-example/pom.xml#L28. But of course we could do the opposite: switch to a newer version of jdt if the current JDK is at least Java 21 ;) |
unfortunately i dont find the time to experiment with gradle and maven |
@szarnekow @cdietrich some updates:
Concerning gradle, if it doesn't pick the Maven profile correctly, it's just a matter of forcing a more recent version of jdt.core in the xtend-maven-plugin configuration |
the problem is gradle does not use the xtend-maven-plugin. |
then, the updated jdt core versions should be specified there
please, see my comments above: I added tests in that respect, both for xtext-maven-plugin and xtend-maven-plugin |
so you propose doing the override in the gradle wizard and write a "what to do in xbase case" guide for gradle |
Yes, that would be a good strategy! |
but the experience shows this is very very very very very error prone |
That's the best we can do. In the worst case, gradle users will not be able to use Java 21, which is the current state anyway. For the rest, nothing will be broken. |
yeah but then we need an error / warning in the wizard etc... thus my preference regarding sebastians proposal:
|
Please see my comments above. My proposed solution would allow us to keep Java 11 while still providing support for Java 21 for those who want to move to Java 21. |
Java 21 is supported since 2.35.0. Can this be closed or what are the points still open that need to be done? |
I think it could be closed, @cdietrich wdyt? |
@LorenzoBettini afaik this needs your open pr for actual support with no workarounds in gradle |
Ah, you mean the one about Java 17 right? |
yes |
Once Java 21 LTS is out we should try to support it
TODO: 100 things i have forgot
The text was updated successfully, but these errors were encountered: