Skip to content
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 JDK 20 support? #807

Closed
b4sjoo opened this issue Jun 9, 2023 · 2 comments
Closed

Add JDK 20 support? #807

b4sjoo opened this issue Jun 9, 2023 · 2 comments

Comments

@b4sjoo
Copy link

b4sjoo commented Jun 9, 2023

Describe the feature
Do you have any timeline in adding support for JDK 20.

Additional context
https://openjdk.org/projects/jdk/20/

Issue:
Right now we need to use JDK 20 to do the gradle build but task delombok failed with following message:

Exception in thread "main" java.lang.NoSuchFieldError: var
	at lombok.delombok.PrettyPrinter.visitForeachLoop(PrettyPrinter.java:1256)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCEnhancedForLoop.accept(JCTree.java:1232)
	at lombok.delombok.PrettyPrinter.print(PrettyPrinter.java:226)
	at lombok.delombok.PrettyPrinter.print(PrettyPrinter.java:240)
	at lombok.delombok.PrettyPrinter.visitBlock(PrettyPrinter.java:1133)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1088)
	at lombok.delombok.PrettyPrinter.print(PrettyPrinter.java:226)
	at lombok.delombok.PrettyPrinter.visitMethodDef(PrettyPrinter.java:857)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:912)
	at lombok.delombok.PrettyPrinter.print(PrettyPrinter.java:226)
	at lombok.delombok.PrettyPrinter.printClassMembers(PrettyPrinter.java:617)
	at lombok.delombok.PrettyPrinter.visitClassDef(PrettyPrinter.java:556)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:810)
	at lombok.delombok.PrettyPrinter.print(PrettyPrinter.java:226)
	at lombok.delombok.PrettyPrinter.visitTopLevel(PrettyPrinter.java:482)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:549)
	at lombok.delombok.DelombokResult.print(DelombokResult.java:74)
	at lombok.delombok.Delombok.delombok(Delombok.java:819)
	at lombok.delombok.Delombok.main(Delombok.java:326)
	at lombok.delombok.DelombokApp.runDirectly(DelombokApp.java:176)
	at lombok.delombok.DelombokApp.runApp(DelombokApp.java:47)
	at lombok.core.Main.go(Main.java:130)
	at lombok.core.Main.main(Main.java:43)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at lombok.launch.Main.main(Main.java:46)

> Task :opensearch-ml-plugin:delombok FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':opensearch-ml-plugin:delombok'.
> Process 'command '/opt/java/openjdk-20/bin/java'' finished with non-zero exit value 1
@dhrubo-os
Copy link

For the ml-commons repo, when we execute ./gradlew :opensearch-ml-plugin:delombok we see this error for JDK 20.

I executed the same command with JDK 17 and JDK 19.0.2 and didn't find any issue. Command execution was successful.

But for JDK 20.0, we are facing error. Details here

@Frisch12
Copy link
Member

Hi @dhrubo-os,

Unfortunately that's an issue for projectlombok itself.
Have a look at these issues in their repository:
projectlombok/lombok#3393
projectlombok/lombok#3353

It seems that it is currently available on the latest snapshots. However, for a release versions there are still some tests failing.

I'm pretty sure we're able to update the Lombok dependency as soon as there is a final release.

Thank you,
Dennis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants