-
Notifications
You must be signed in to change notification settings - Fork 86
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
Add support for JDK 19 #184
Comments
Please explain your use case. What in Java 19 is not working with AspectJ 1.9.9.1? Why do you need the AspectJ compiler to create Java 19 class files or the weaver to read them? Other than preview or incubating language features, there is nothing new in Java 19. Please explain, which features you are using and why. I wish to understand your impediment. |
I have a project using dev.aspectj:aspectj-maven-plugin and I switched the project to compile for Java 19 and it fails with:
So my use case is that I want to be able to compile with 19 as the target. My config for the plugin is:
I assumed it is the issue with aspectj part - hence reported it here. |
Of course I know that AspectJ does not support Java 19 yet, because the upstream Eclipse Java compiler just released its Java 19 version a few days ago. I am working and do not have lots of cycles to work on AspectJ in my spare time, but eventually I will add Java 19 support. Anyway, you did not answer my questions. Please read again and reply accordingly. Thank you. At the moment, your issue description is simply a feature request without any explained reason or benefit. |
The sole benefit is support current Java version. And yes it is a feature request. |
You can use all security fixes by compiling to compliance level 18 or lower while using JDK 19. If you want to test Java preview features, you can also do so without AspectJ for the time being. What I wanted to find out is if you use AspectJ in any commercial environment and are somehow compelled to upgrade to the new preview language features. Obviously, you are not. You did not give any example of which Java 19 feature you urgently need to work with in AspectJ. Maybe you can imagine that product maintainers prioritise raised issues. If you want me to prioritise this one, you need to give me a better reason than you simply wishing to play with the new preview features. Otherwise, maybe fixing bugs gets prioritised over upgrading JDK compatibility, given the very limited size of my time budget, not to mention Andy's which is even smaller (basically zero in his case). |
I have a first Java 19 development version of AspectJ, mostly untested. I just quickly compiled an example for JEP 405: Record Patterns (Preview), which worked nicely. At snapshot repository https://oss.sonatype.org/content/repositories/snapshots, you find version <executions>
<execution>
<id>default-compile</id>
<phase>none</phase>
</execution>
<execution>
<id>default-testCompile</id>
<phase>none</phase>
</execution>
</executions> I am not sure if I will have more time this weekend to add proper tests to the AspectJ build, so you might bump into bugs. @krzyk, you asked for this feature somehwat cheekily without giving any good reason for me to invest time, other than "I want to play with Java 19". Now I am expecting you to test as much as possible and provide feedback, making this worthwhile for me and also helping yourself to get what you want. @mdeinum, following up on our e-mails, I am also asking you to give it a spin. |
Works for my usecase. I use loadtime weaving and compile using Java19 with preview features enabled. Although I don't use them in this part of the project. I now get the expected behavior and no more ASM errors!. Thanks for tagging me, I was just about to write you an answer to the email (it worked compiling to Java18 as well as I don't use any preview features in this section). |
Thanks for your feedback, @mdeinum. I am happy it works for you. Yes, most people should have the same use case: They want to use the latest JDK (more conservative ones maybe the latest LTS) due to security fixes, but it does not necessarily mean that they need to use the latest Java language features, especially not preview ones or even incubating ones. Of course they want to try them, but they would never use them in business or widely used OSS projects, because a preview feature compiled by Java Anyway, maybe I can add some testing infrastructure to AspectJ and release 1.9.10 soon, even though I am not promising anything. On weekends this can depend not only on how long it takes to write the code, but also on things like weather or whoever of my friends calls me to meet up spontaneously. Sometimes even I have a bit of private life. 😁 |
FYI, I could in principle release a new version of AspectJ, which will be 1.9.19 (not 1.9.10) in order to sync the minor-minor (1.9.x) version to the Java release in the future for users to more easily recognise the latest supported Java version of AspectJ. 1.19 would be even nicer, but minor versions (1.x) require an Eclipse review which I do not have time for. Anyway, what is blocking the release? There are upstream issues with ECJ, the Eclipse Java Compiler with regard to preview feature implementation. I noticed those problems while creating simple smoke tests for AspectJ:
I could either release AspectJ with known issues or wait for the upstream problems to be fixed. Let's see if someone from the resource-starved JDT Core team can take time to fix this anytime soon. They are really busy, juggling many balls at once. |
I have decided to no longer delay the 1.9.19 (Java 19) release and rather mention the open ECJ bugs in the release notes instead. I have added tests also for the buggy compiler features, but deactivated them for now. We can always activate them after the bugs will have bveen fixed. |
Is this missing java 19? |
It was, indeed. I just fixed that. Nice catch! |
Please add support for JDK 19.
Thank you very much.
The text was updated successfully, but these errors were encountered: