I've just tried upgrading my project to Java 15, and now I get the following error:
both interface org.jooq.Record in org.jooq and class java.lang.Record in java.lang match
Does anybody have some experience resolving this issue?
I've just tried upgrading my project to Java 15, and now I get the following error:
both interface org.jooq.Record in org.jooq and class java.lang.Record in java.lang match
Does anybody have some experience resolving this issue?
In addition to what Aniket already said:
Record
The recommendation is to add an explicit import to your import-on-demand statement:
import org.jooq.*;
import org.jooq.Record;
Or to stop using import-on-demand entirely. E.g. in Eclipse, you can use the "Organize Imports" feature to expand all your import-on-demand statements to explicit imports, depending on the types you're actually using.
Another way to prevent this problem if it happens with local variables is to use var
:
var record = ctx.fetchOne(TABLE, TABLE.ID.eq(1));
Now you don't have to import the type. This doesn't work with member types, method parameter and return types, of course.
We'll try to better document this: https://github.com/jOOQ/jOOQ/issues/10646
Java 14 introduced records. java.lang.Record
is a superclass of record
which is conflicting with org.jooq.Record
since every type in java.lang
is auto imported. There are two solutions:
Record
and remove the import. Eg: org.jooq.Record
instead of Record
. (Don't forget to remove the import
statement).org.jooq.Record
to something specific. (Which I believe is not possible in your case as it's a third-party library.)© 2022 - 2024 — McMap. All rights reserved.
import org.jooq.Record;
instead of justimport org.jooq.*;
– Erratic