JOOQ 3.17.1 appears to be generating source that won't work with Java 11 - java-11

After upgrading to jooq 3.17.1 I get the following error:
Error:
/home/runner/work/waste-coordinator/waste-coordinator/webapp/target/generated-sources/jooq/com/myapp/portal/backend/jooq/tables/LoadView.java:[521,84]
text blocks are not supported in -source 11 Error: (use -source 15
or higher to enable text blocks)
It appears to me that it is generating source that is not compatible with JDK11. Is there a flag in the generator somewhere that can make it generate JDK 11 compatible code?
Edit: now I am getting the following compile error
[ERROR] COMPILATION ERROR : [INFO]
------------------------------------------------------------- [ERROR] /usr/local/code/sferion/WasteCoordinator/data/src/main/java/com/wastecoordinator/data/JOOQGenerator.java:[4,24]
cannot access org.jooq.codegen.GenerationTool bad class file:
/Users/benstpierre/.m2/repository/org/jooq/jooq-codegen/3.17.1/jooq-codegen-3.17.1.jar(/org/jooq/codegen/GenerationTool.class)
class file has wrong version 61.0, should be 55.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
Is jooq 3.17 not compatible with JDK 11?

You can download the right distribution to work with JDK 11 from here if you're licensed:
https://www.jooq.org/download/versions
Note that starting from jOOQ 3.17, the jOOQ Open Source Edition increased the baseline JDK version to Java 17, see:
https://github.com/jOOQ/jOOQ/issues/12430
https://blog.jooq.org/3-17-0-release-with-computed-columns-audit-columns-pattern-matching-reactive-transactions-and-kotlin-coroutine-support/
jOOQ is a bit early here, given that Spring will increase their own baseline only later in 2022:
https://spring.io/blog/2021/09/02/a-java-17-and-jakarta-ee-9-baseline-for-spring-framework-6
But jOOQ will continue to provide paid support for older JDKs for quite a while, still. At the same time, jOOQ 3.14 - 3.16 will receive patches for another while, too.

Related

After upgrading karate version to 1.0.0 cucumber reports are not generated

After upgrading karate version to 1.0.0 cucumber reports are not generated. though no test is failed
Error message:
Mar 17, 2021 4:54:06 PM net.masterthought.cucumber.ReportBuilder generateErrorPage
INFO: Unexpected error
net.masterthought.cucumber.ValidationException: None report file was added!
at net.masterthought.cucumber.ReportParser.parseJsonFiles(ReportParser.java:61)
Note:
Working fine with 0.9.6 version
As per upgrade notes: https://github.com/intuit/karate/wiki/1.0-upgrade-guide
HTML reports (and other artifacts) will be in target/karate-reports (or build/karate-reports for Gradle)
so if your CI was pointing to /surefire-reports, this has to be changed
The Cucumber JSON and JUnit XML files are NOT output by default
use the builder methods on the Runner, there is also outputJunitXml(true)
Results results = Runner.path("classpath:demo")
.outputCucumberJson(true)
.tags("~#ignore").parallel(5);
If you change as per above in your runner - reports will be generated.

Gradle build doing nothing on WSL

I'm writing a Kotlin program, and using Gradle as the build system, as is customary in that language. I usually work on Windows, but it's time to start testing on Linux, so using WSL for that. Installed Gradle, cloned a copy of my code in WSL...
(base) a#DESKTOP-4B7M920:~/ayane$ gradle -version
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/usr/share/java/groovy-all.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
------------------------------------------------------------
Gradle 4.4.1
------------------------------------------------------------
Build time: 2012-12-21 00:00:00 UTC
Revision: none
Groovy: 2.4.16
Ant: Apache Ant(TM) version 1.10.5 compiled on March 28 2019
JVM: 11.0.7 (Ubuntu 11.0.7+10-post-Ubuntu-2ubuntu218.04)
So far so good, that warning happens sometimes, doesn't seem to portend immediate trouble.
This is my build file, that works on Windows:
(base) a#DESKTOP-4B7M920:~/ayane$ cat build.gradle.kts
plugins {
kotlin("jvm") version "1.3.72"
}
repositories {
jcenter()
}
dependencies {
implementation(kotlin("stdlib"))
testImplementation("org.junit.jupiter:junit-jupiter:5.6.2")
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
Here goes.
(base) a#DESKTOP-4B7M920:~/ayane$ gradle build
> Task :buildEnvironment
------------------------------------------------------------
Root project
------------------------------------------------------------
classpath
No dependencies
BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed
<-------------> 0% WAITING
Uh? I could understand if it threw an error because some prerequisite or other was unavailable. But no error, just nothing? What's going on?
You are using the newest version at this time of the Kotlin plugin for Gradle (1.3.72). However, you are using a really old version of Gradle (4.4.1). As you can read from the Kotlin documentation:
The Kotlin Gradle plugin 1.3.72 works with Gradle 4.9 and later.
It is unfortunate that the plugin doesn't check for this and give a more proper error message instead of just silently doing nothing. I guess you could create an issue for Jetbrains on this if you like.
Just as has been mentioned in the comment to your question, I also highly recommend using the wrapper. It ensures that the project is built with a particular declared version of Gradle that you, the build author, has decided on. Otherwise, you will have to document how to set up the environment correctly, including what version of Gradle to install.
Same thing goes for Java: be sure to clearly document which version is required or supported.
As for building in WSL, the only issue I've ever had with it was a remote build cache not working. This was because I had configured Git to checkout with POSIX line endings (LF) for source files, whereas the cache were populated on a Windows machine using CRLF line endings). It doesn't sound like you are using that feature, but other than that, everything has been working fine for me in WSL.

GluonMobile + Jackson = java.lang.NoClassDefFoundError: java.util.function.ToLongFunction

I'm porting a desktop JavaFx Application that requires Jackson to GluonMobile, it's my first time using this platform and I end up on the next stacktrace with a NoClassDefFoundError.
I would like to know if this requires a feature not supported by GluonMobile or if I just forgot to include something properly.
Apr 19, 2018 8:25:02 PM com.fasterxml.jackson.databind.ext.Java7Support <clinit>
WARNING: Unable to load JDK7 types (annotations, java.nio.file.Path): no Java7 support added
[WARN] java.lang.Class: Class.forName() failed to load 'javax.servlet.Servlet'. Use the -forcelinkclasses command line option or add <forceLinkClasses><pattern>javax.servlet.Servlet</pattern></forceLinkClasses> to your robovm.xml file to link it in.
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
TRACE Task Catching
java.lang.NoClassDefFoundError: java.util.function.ToLongFunction
at java.lang.VMClassLoader.findClassInClasspathForLoader(Native Method)
at java.lang.PathClassLoader.findClass(PathClassLoader.java:193)
at java.lang.ClassLoader.loadClass(ClassLoader.java:515)
at java.lang.ClassLoader.loadClass(ClassLoader.java:475)
at com.fasterxml.jackson.datatype.jsr310.ser.InstantSerializer.<init>(InstantSerializer.java:38)
at com.fasterxml.jackson.datatype.jsr310.ser.InstantSerializer.<clinit>(InstantSerializer.java:35)
at com.fasterxml.jackson.datatype.jsr310.JavaTimeModule.<init>(JavaTimeModule.java:161)
at com.general.plugin.jackson.json.JacksonObjectMapper.<clinit>(JacksonObjectMapper.java:214)
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:218)
at java.lang.Class.forName(Class.java:176)
at com.general.core.startup.Configuration.getSharableInstance(Configuration.java:69)
at com.general.core.startup.AbstractClient.<init>(AbstractClient.java:39)
at com.objectdb.core.startup.Client.<init>(Client.java:31)
at com.objectdb.ui.service.ClientFactory.getDBClient(ClientFactory.java:39)
at com.objectdb.ui.service.ClientTask.getDBClient(ClientTask.java:13)
at com.objectdb.ui.startup.Main$2.call(Main.java:30)
at javafx.concurrent.Task$TaskCallable.call(Task.java:1423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.lang.Thread.run(Thread.java:837)
This solution is quite a workaround that requires a bit of work.
Fixes Jackson 2.9.5 to work in gluon jfxmobile-plugin 1.3.10.
To fix jackson-databind to be able build immutable objects with a single constructor.
1.1 Drop the usage of the JDK8 module parameter-names since this requires a non implemented VM feature.
Use instead java.beans.ConstructorProperties.
1.2 Jackson uses for ConstructorProperties support some Interfaces from JDK8 that can be safety included as part of your project.
java.beans.ConstructorProperties
java.beans.Transient
1.3 Force link JDK7 support
forceLinkClasses = [
'com.fasterxml.jackson.databind.ext.Java7SupportImpl',
]
To fix jackson-datatype-jsr310.
2.1 It uses some JDK8 interfaces that can be safety included in your project.
java.util.function.ToIntFunction
java.util.function.ToLongFunction
2.2 It uses some JDK8 methods that can be safety substituted by JDK6-7 implementations, simply include in your project the java files and look up the pre-JDK8 back ports of the Time API.
JavaTimeModule.java
SerializerToPach.java
3.3 Point your own JavaTimeModule to your own serializer.
3.4 Register in your ObjectMapper your own JavaTimeModule.
Voila, now you can use the lattest Jackson to create immutable objects and use JDK8 Time classes in gluon jfxmobile-plugin 1.x

InteliJ SBT auto import of scala project gives: Binary incompatibility in plugins detected

I was working happily in InteliJ with scala 2.10 and Java 1.7 - and am in the process of trying to upgrade to scala 2.11 and Java 1.8
I'm on Ubuntu 14 -- and javac shows
update-alternatives --config javac
There are 2 choices for the alternative javac (providing /usr/bin/javac).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-8-oracle/bin/javac 4 auto mode
1 /usr/lib/jvm/java-7-oracle/bin/javac 3 manual mode
* 2 /usr/lib/jvm/java-8-oracle/bin/javac 4 manual mode
As I have both java 7 and 8 installed.
I'm trying to import a Play 2.3 project (using the IntelJ SBT auto import) and am getting the error
Error while importing SBT project: ... at xsbt.boot.Boot$.main(Boot.scala:20) at xsbt.boot.Boot.main(Boot.scala) [error] sbt.IncompatiblePluginsException: Binary incompatibility in plugins detected. [error] Note that conflicts were resolved for some dependencies: [error] com.github.mpeltonen:sbt-idea [error] commons-io:commons-io [error] org.apache.commons:commons-lang3
......
I'm not sure how to progress investigating this; but my thinking is
From - Sbt plugin binary incompatibility - it could relate to the version on SBT that inteliJ is using?
Another thought was; Is the InteliJ Scala Plugin specific to a Java version (7 vs 8?) If so - how do I make sure InteliJ gets the correct one? I tried re-installing the plugin; but that didn't change anything.
Thanks
Brent
Ah; I just had to update Project Settings to use 1.8!

Could not compile project in Intellij Idea 13 EAP/12.1.5 due to Lombok usages

While trying Intellij Idea 13 EAP ( which I'm aware is not stable ) I could not compile/run a working project because of the following warning:
java: lombok.javac.apt.Processor could not be initialized. Lombok will not run during this compilation: java.lang.ClassCastException: com.sun.tools.javac.processing.JavacProcessingEnvironment cannot be cast to com.sun.tools.javac.processing.JavacProcessingEnvironment
at lombok.javac.apt.Processor.init(Processor.java:84)
at lombok.core.AnnotationProcessor$JavacDescriptor.want(AnnotationProcessor.java:89)
at lombok.core.AnnotationProcessor.init(AnnotationProcessor.java:143)
It's working very well with Intellij Idea 12, but I need to run on 13 because of an another issue fixed only in 13 (IDEA-104616)
This error comes up:
com.sun.tools.javac.processing.JavacProcessingEnvironment cannot be cast to com.sun.tools.javac.processing.JavacProcessingEnvironment
Update:
Created JetBrains issue: IDEA-114130
It is an Intellij IDEA issue: IDEA-114130
Fixed in build 132.474
Note: Reproducible in Intellij IDEA 12.1.5; avoid upgrade (in case of Lombok use) !
UPDATE:
FIxed version is publicly released.