Hi Syam,
is there a specific reason it is build with Java 17?
Since Vaadin went to Java 11 in Vaadin 23 it would be good to align your version to Java 11 also.
Thank you
Chris
Hi Syam,
is there a specific reason it is build with Java 17?
Since Vaadin went to Java 11 in Vaadin 23 it would be good to align your version to Java 11 also.
Thank you
Chris
Hi,
Java 17 is the latest LTS version.
Also, Java >11 supports a bunch of new features. Mostly, I used records, switch expressions, instanceof pattern matching etc. in the code. (One of the tools used in Vaadin build-chain had a problem with handling of record
but it was fixed quite some time ago).
Vaadin’s decision to switch only to Java 11 now is unfortunate but they may have their own reasons like supporting the migration efforts of their paid customers.
I recommend everyone to switch to Java 17 instead of Java 11 because you hardly come across any compatibility issues between 11 and 17.
Hi Syam,
I agree with you to switch to Java 17 mostly because is LTS.
Unfortunately the use of records brake the use of Jetty 9 too as you can read here in this runtime error:
java.lang.RuntimeException: Error scanning file /Users/fox/Documents/workspace/plcProject/so-charts/so-charts/classes/main-java/com/storedobject/chart/FunctionData$Streamer.class
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:760) ~[jetty-annotations-9.4.31.v20200723.jar:9.4.31.v20200723]
at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:847) ~[jetty-annotations-9.4.31.v20200723.jar:9.4.31.v20200723]
at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:159) ~[jetty-annotations-9.4.31.v20200723.jar:9.4.31.v20200723]
at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:455) ~[jetty-annotations-9.4.31.v20200723.jar:9.4.31.v20200723]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:882) ~[jetty-util-9.4.39.v20210325.jar:9.4.39.v20210325]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1036) ~[jetty-util-9.4.39.v20210325.jar:9.4.39.v20210325]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.UnsupportedOperationException: Record requires ASM8
at org.objectweb.asm.ClassVisitor.visitRecordComponent(ClassVisitor.java:305) ~[asm-9.1.jar:9.1]
at org.objectweb.asm.ClassReader.readRecordComponent(ClassReader.java:930) ~[asm-9.1.jar:9.1]
at org.objectweb.asm.ClassReader.accept(ClassReader.java:708) ~[asm-9.1.jar:9.1]
at org.objectweb.asm.ClassReader.accept(ClassReader.java:401) ~[asm-9.1.jar:9.1]
at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:952) ~[jetty-annotations-9.4.31.v20200723.jar:9.4.31.v20200723]
at org.eclipse.jetty.annotations.AnnotationParser.parseDir(AnnotationParser.java:753) ~[jetty-annotations-9.4.31.v20200723.jar:9.4.31.v20200723]
... 6 more
I have patched your code removing the record and I will provide you a pull request for you; feel free to drop it if you think differently; I personaly think that the use of record brakes too much really diffuses libraries and it’s still risky.
Regards,
Stefano
IMO a single library shouldn’t force developers to switch to another Java version.
That said, I respect your decision. Keep up the good work.
Which jetty version are you using?
As written above the version 9.4.45.v20220203
fixed this problem too!
Regards,
S.