Repository navigation
Symbols not getting resolved for lombok on vs code #3909
Description
Activity
@VincentLee-EN Could you attach a project example reproducing the error?
- How?…----------Reply to Message---------- On Thu, Jan 2, 2025 22:38 PM ***@***.***> wrote: @VincentLee-EN Could you attach a project example reproducing the error? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: ***@***.***>
Is it because I'm using Java 17 that the plugin doesn't support it very well yet?
How?
You can try
Paste, drop or click to add filesIs it because I'm using Java 17 that the plugin doesn't support it very well yet?
You need Java 23 to use javac -
"java.jdt.ls.javac.enabled": "on",How?
You can try
Paste, drop or click to add filesIs it because I'm using Java 17 that the plugin doesn't support it very well yet?
You need Java 23 to use javac -
"java.jdt.ls.javac.enabled": "on",My project uses Java17,is it a good idea to upgrade it to Java23?
Or if there is any better solution to user javac while Java version is 17?How?
You can try
Paste, drop or click to add filesIs it because I'm using Java 17 that the plugin doesn't support it very well yet?
You need Java 23 to use javac -
"java.jdt.ls.javac.enabled": "on",My project uses Java17,is it a good idea to upgrade it to Java23? Or if there is any better solution to user javac while Java version is 17?
here is my settings.json for java after I installed java23, but it didn't work, is the config is wrong?
"java.jdt.ls.java.home": "/home/vincent/tools/java/jdk-23.0.1",
"java.jdt.ls.javac.enabled": "on",
"java.configuration.runtimes": [
{
"name": "JavaSE-17",
"path": "/home/vincent/tools/java/jdk-17.0.12",
"default": true
},
{
"name": "JavaSE-23",
"path": "/home/vincent/tools/java/jdk-23.0.1",
}
],My project uses Java17
Your project can use Java >= 1.8
here is my settings.json for java after I installed java23, but it didn't work, is the config is wrong?
Could you try the following:
- install VS Code
Pre-Release - add
<your_project>/.settings//org.eclipse.jdt.apt.core.prefswith the following contents
eclipse.preferences.version=1 org.eclipse.jdt.apt.aptEnabled=true org.eclipse.jdt.apt.genSrcDir=.apt_generated org.eclipse.jdt.apt.genTestSrcDir=.apt_generated_tests org.eclipse.jdt.apt.reconcileEnabled=true- Open the command palette (F1)
- select
Java: Clean the Java Language Server Workspace - select
Restart and delete from the confirmation prompt
- install VS Code
here is my settings.json for java after I installed java23, but it didn't work, is the config is wrong?
Could you try the following:
- install VS Code
Pre-Release - add
<your_project>/.settings//org.eclipse.jdt.apt.core.prefswith the following contents
eclipse.preferences.version=1 org.eclipse.jdt.apt.aptEnabled=true org.eclipse.jdt.apt.genSrcDir=.apt_generated org.eclipse.jdt.apt.genTestSrcDir=.apt_generated_tests org.eclipse.jdt.apt.reconcileEnabled=true- Open the command palette (F1)
- select
Java: Clean the Java Language Server Workspace - select
Restart and delete from the confirmation prompt
I followed these steps, and it did not resolve the issue for me.
I also reported this issue when javac experimental support is release and since then I switched back to ECJ.
- install VS Code
@VincentLee-EN I can't reproduce the issue.
Please attach a project example reproducing the issue.@VincentLee-EN I can't reproduce the issue. Please attach a project example reproducing the issue.
I don't know if this will work properly, since it is impossible to be completely consistent for the environment and configuration between you and me
@snjeza, you can try with this sample project. Lombok working fine with ECJ but failing when using Javac as the compiler(using JDK 23 for the language server).
I see the following errors in the
Language Support for JavaOutput window:[Error - 4:55:33 PM] Feb 4, 2025, 4:55:33 PM Error in calling delegate command handler java.lang.AbstractMethodError: Receiver class lombok.javac.Javac$JavadocOps_8$1 does not define or inherit an implementation of the resolved method 'abstract com.sun.tools.javac.util.JCDiagnostic$DiagnosticPosition getPos()' of interface com.sun.tools.javac.parser.Tokens$Comment. java.lang.RuntimeException: java.lang.AbstractMethodError: Receiver class lombok.javac.Javac$JavadocOps_8$1 does not define or inherit an implementation of the resolved method 'abstract com.sun.tools.javac.util.JCDiagnostic$DiagnosticPosition getPos()' of interface com.sun.tools.javac.parser.Tokens$Comment. at org.eclipse.jdt.core.dom.JavacCompilationUnitResolver.parse(JavacCompilationUnitResolver.java:844) at org.eclipse.jdt.core.dom.JavacCompilationUnitResolver.toCompilationUnit(JavacCompilationUnitResolver.java:545) at org.eclipse.jdt.core.dom.ASTParser.internalCreateASTCached(ASTParser.java:1392) at org.eclipse.jdt.core.dom.ASTParser.lambda$1(ASTParser.java:1271) at org.eclipse.jdt.internal.core.JavaModelManager.cacheZipFiles(JavaModelManager.java:5708) at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1271) at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:915) at org.eclipse.jdt.internal.core.CompilationUnit.buildStructure(CompilationUnit.java:175) at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:250) at org.eclipse.jdt.internal.core.SourceRefElement.generateInfos(SourceRefElement.java:127) at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:569) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:292) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:278) at org.eclipse.jdt.internal.core.JavaElement.exists(JavaElement.java:195) at org.eclipse.jdt.internal.core.CompilationUnit.findPrimaryType(CompilationUnit.java:716) at com.microsoft.jdtls.ext.core.PackageCommand.getChildrenForPackage(PackageCommand.java:429) at com.microsoft.jdtls.ext.core.PackageCommand.getPackageChildren(PackageCommand.java:408) at com.microsoft.jdtls.ext.core.PackageCommand.getChildren(PackageCommand.java:110) at com.microsoft.jdtls.ext.core.CommandHandler.executeCommand(CommandHandler.java:31) at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:230) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47) at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:220) at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:615) at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87) at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:690) at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:527) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1460) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2036) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:189) Caused by: java.lang.AbstractMethodError: Receiver class lombok.javac.Javac$JavadocOps_8$1 does not define or inherit an implementation of the resolved method 'abstract com.sun.tools.javac.util.JCDiagnostic$DiagnosticPosition getPos()' of interface com.sun.tools.javac.parser.Tokens$Comment. at org.eclipse.jdt.core.dom.JavadocConverter.<init>(JavadocConverter.java:103) at org.eclipse.jdt.core.dom.JavacConverter.convert(JavacConverter.java:3473) at org.eclipse.jdt.core.dom.JavacConverter.setJavadocForNode(JavacConverter.java:1285) at org.eclipse.jdt.core.dom.JavacConverter.commonSettings(JavacConverter.java:495) at org.eclipse.jdt.core.dom.JavacConverter.commonSettings(JavacConverter.java:457) at org.eclipse.jdt.core.dom.JavacConverter.convertMethodDecl(JavacConverter.java:926) at org.eclipse.jdt.core.dom.JavacConverter.convertBodyDeclaration(JavacConverter.java:826) at org.eclipse.jdt.core.dom.JavacConverter.convertClassDecl(JavacConverter.java:678) at org.eclipse.jdt.core.dom.JavacConverter.convertClassDecl(JavacConverter.java:598) at org.eclipse.jdt.core.dom.JavacConverter.convertBodyDeclaration(JavacConverter.java:829) at org.eclipse.jdt.core.dom.JavacConverter.convertClassDecl(JavacConverter.java:678) at org.eclipse.jdt.core.dom.JavacConverter.convertClassDecl(JavacConverter.java:598) at org.eclipse.jdt.core.dom.JavacConverter.convertBodyDeclaration(JavacConverter.java:829) at org.eclipse.jdt.core.dom.JavacConverter.lambda$populateCompilationUnit$4(JavacConverter.java:200) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:215) at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:570) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:560) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:265) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:636) at org.eclipse.jdt.core.dom.JavacConverter.populateCompilationUnit(JavacConverter.java:202) at org.eclipse.jdt.core.dom.JavacCompilationUnitResolver.parse(JavacCompilationUnitResolver.java:748) ... 29 moreReacted by Snjeza@snjeza, did this help you to reproduce the issue?
did this help you to reproduce the issue?
Yes, I was able to reproduce the issue. I'm working on it.
Reacted by Viswa Teja Nariboina5 remaining items
@snjeza, I see lombok released 1.18.38 with a fix and you made necessary changes in the jdtls. May I know in which version of VS Code this issue will be resolved with the javac enabled?
@viswatejan You can try VS Code 1.41.1 or pre-release.
You need to set"java.jdt.ls.lombokSupport.enabled": falseReacted by Viswa Teja Nariboina@viswatejan You have to start VS Code with Java 24. See #4029 (comment)
@snjeza, I followed the instructions but now the demo app is failing with the following issue
INFO: -<- Done loading .javaASTValidators extension point -<- [Error - 12:17:47 PM] Apr 28, 2025, 12:17:47 PM compilation failed java.lang.ExceptionInInitializerError java.lang.RuntimeException: java.lang.ExceptionInInitializerError at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:168) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.generate(JavacTaskImpl.java:445) at org.eclipse.jdt.internal.javac.JavacCompiler.compile(JavacCompiler.java:215) at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:442) at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:250) at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:373) at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:118) at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:311) at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:217) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1077) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:296) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:352) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:441) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:444) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:555) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:503) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:585) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:207) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:300) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) Caused by: java.lang.ExceptionInInitializerError at lombok.javac.apt.LombokProcessor.placePostCompileAndDontMakeForceRoundDummiesHook(LombokProcessor.java:174) at lombok.javac.apt.LombokProcessor.init(LombokProcessor.java:96) at lombok.core.AnnotationProcessor$JavacDescriptor.want(AnnotationProcessor.java:160) at lombok.core.AnnotationProcessor.init(AnnotationProcessor.java:213) at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.init(AnnotationProcessor.java:64) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:633) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:760) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:856) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1199) at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1312) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1272) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1174) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.enter(JavacTaskImpl.java:348) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:399) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.generate(JavacTaskImpl.java:465) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$generate$0(JavacTaskImpl.java:445) at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152) ... 21 more Caused by: java.lang.NoSuchFieldException: com.sun.tools.javac.code.TypeTag :: UNKNOWN at lombok.permit.Permit.getField(Permit.java:144) at lombok.javac.JavacTreeMaker$SchroedingerType.getFieldCached(JavacTreeMaker.java:171) at lombok.javac.JavacTreeMaker$TypeTag.typeTag(JavacTreeMaker.java:259) at lombok.javac.Javac.<clinit>(Javac.java:187) ... 38 more@viswatejan You need to use JDK 24, lombok 1.18.38 and set
"java.jdt.ls.lombokSupport.enabled": false,
Also, try to clean the workspace.Caused by: java.lang.NoSuchFieldException: com.sun.tools.javac.code.TypeTag :: UNKNOWN
This exception is thrown when using older lombok and JDK 24.
@viswatejan Could you attach your project?
@viswatejan Could you try to configure the maven-compiler-plugin as follows:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <annotationProcessorPaths> <path> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.38</version> <!-- use 1.18.38 version --> </path> </annotationProcessorPaths> </configuration> </plugin>@viswatejan Could you try to set:
"java.jdt.ls.vmargs": "-DICompletionEngineProvider=org.eclipse.jdt.core.dom.DOMCompletionEngineProvider <your_vmargs",@viswatejan This is an upstream jdt-core-incubator issue.
You can try to save the file and call the completion again (Ctrl+s, Ctrl+Space).I have enabled auto-save and also even after saving, I am seeing the same.
was it fixed?





My "Language support for Java ™ for Visual Studio Code" is v1.38.0, Symbols not getting resolved for lombok on vs code,but it can still compile and run
when I use @slf4j,here comes errors:

when I use @DaTa, the same situation happens
