Replies: 13 comments
|
Make sure you're using a Lombok version compatible with JDK 26, and review the information in #8221 |
|
I'm using JDK 21 as the NetBeans runtime. I use JDK 21 because I had problems with NetBeans crashing and/or the clipboard not working with the JDK provided by the NetBeans installer. I do use the latest Lombok version (org.projectlombok:lombok:jar:1.18.46:provided), which seems to support JDK 24: projectlombok/lombok#3772 ...and support JDK 26 too: projectlombok/lombok#4019 |
|
The runtime JDK isn't relevant, as you can see in the linked discussion. The IDE editor uses the JDK 26 compiler internally. NB31 will use JDK 27-ea. Lombok is effectively unsupported - it may or may not work, but you're on your own and it's not something that we can do anything about. |
|
If that is the case, then why not just compile stable NetBeans with a stable JDK? Most libraries still work with JDK 17 LTS. Does NetBeans really need to be so close to the bleeding edge in terms of the compiler? Also note that Lombok is used by 35k publicly published projects. One of them is Spring Boot, which has 81k stars on GitHub. Both are actually more popular then NetBeans. And also Lombok does already work with JDK 26 and yet NetBeans fails to detect the Lombok constructor. |
|
I mean, don't get me wrong. I've been a fan of NetBeans for a long time, but as a Tech Lead and simply as a developer, I would love to keep recommending NetBeans to other developers. |
Yes, unless you don't think people using NetBeans should be able to edit any code above JDK 17! The IDE uses a backported version of the latest compiler to parse source code. Lombok is a horrible hack that messes around with the internals of the Java compiler, which is why it continually breaks as NetBeans updates its parsing support for the latest JDKs. It is almost always optional (eg. in Spring Boot), and rapidly becoming unnecessary and part of Java's past. The small volunteer team here is going to keep concentrating our limited time on making NetBeans work well with the latest tools and JDKs.
Sure, but also not the actual issue! It's likely either a configuration problem with the project or something wrong in Lombok. It's possibly caused by an underlying issue with expectations inside the IDE. If the latter, and you find the underlying problem, then please open a report or PR for that. EDIT : possibly make sure you check that |
|
NetBeans uses javac as a library to model the Java source code - for use in code completion, etc. I.e. there's a lot of code in NetBeans that directly links against the javac API, and it is not something that could (or should) be easily avoided or abstracted. So, NetBeans has roughly three options:
I think use of up-to-date javac is the only viable option. It is unfortunate that Lombok sometimes does not work, but I would say that's more a deficiency in Lombok, that it touches internals/non-API. And that the onus is on them to keep Lombok up-to-date with javac internals if they opt to rely on the internals. |
|
Hm... OK. I think I understand the problem better. So, it's not like there are separate modules for autocomplete, linting, and things like that. It's all integrated into NB (or at least no longer separated enough). That's a tough one. I guess one solution for users (devs like me) is not to update to the latest NetBeans version unless all their projects require the latest Java. That's not great, though, because new versions of NB is not only for Java, it also bring better support for things like JavaScript and CSS editing. And current installer is replacing previous version, which most of the time is good, but in this case not so much. So... Even if supporting multiple There is another option: provide a plugin for Lombok. I'm not sure how feasible that is, since I haven't developed a NetBeans plugin yet. There is a plugin for IntelliJ IDEA, which, unfortunately, is what most of my team uses. IJ has its own set of problems, but it does have Lombok support. |
Not that it's relevant to your current issue, but we already recommend anyone who must use Lombok stick with even-numbered NetBeans releases, as they should always contain a GA compiler rather than an EA one. Please ensure annotation processing is actually running in the editor too.
I do love it when people volunteer other people's free time! 😉 Realistically, it's not happening. As @lahodaj says, what we have is really the only viable option. Any deficiency is in Lombok. @lahodaj thanks for that good summary. I think we should reconsider a pinned issue on this, rather than the pinned discussion at https://github.com/apache/netbeans/discussions/categories/tips-tricks-and-workarounds that we ended up with. We seem to keep answering similar questions. Perhaps we can quote or summarize what you said above. |
No worries, I don't expect you to drop everything and work on it 😉. I don't even realistically expect to change your mind in this discussion. I'm a volunteer too, e.g. admin and dev on Wikipedia, and I always say I'll think about it... and sometimes get to it. That's all there is to it.
Perhaps that distinction should be made clearer in the documentation or other communications. I don't recall reading anything like that recently. It might be a good idea to mention different release tracks on the downloads page: |
|
I am not super interested in lombok issues, but a quick test with (but as others mentioned it didn't work using the voting candidate of NB 31 since lombok doesn't support JDK 27 yet for some reason). however:
by error you mean warning? or the other way around? This almost sounds like a second annotation processor doesn't see the result of the first processor. It is unclear to me where that message is coming from. |
|
I'm going to move this over to discussions, because I'm not sure if there's anything to look at here. @Eccenux if you can provide a minimal, reproducible example project then it's perhaps something someone can take a look at. |

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Apache NetBeans version
Apache NetBeans 30
What happened
I keep getting a warning "No constructors can de found that match the argument types" for HQL with DTO class.
Language / Project Type / NetBeans Component
Java Maven Web application project
How to reproduce
Package structure (simplified):
in example-api:
in example-core:
Did this work correctly in an earlier version?
No
Operating System
Windows 11 version 10.0 running on amd64; UTF-8; pl_PL (nb)
JDK
Runtime: OpenJDK Runtime Environment 21.0.8+9-LTS
Apache NetBeans packaging
Community provided installer
Anything else
That error is always shown when using DTO class in HQL.
Oh, and the project is based on Spring MVC + Hibernate + HikariCP data-source if that matters.
Are you willing to submit a pull request?
No
All reactions