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

Lombok fails with JDK 10 #1572

Closed
krzyk opened this issue Feb 5, 2018 · 88 comments
Closed

Lombok fails with JDK 10 #1572

krzyk opened this issue Feb 5, 2018 · 88 comments

Comments

@krzyk
Copy link
Contributor

krzyk commented Feb 5, 2018

EDIT: See #1572 (comment) for minimal example

I tried to build a project with JDK 10, so we could make lombok work with it sooner than it was with JDK 9.
(the build works with JDK 9, so changed compiler to JDK 10)

lombok 1.6.20

Maven version:

Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T09:58:13+02:00)
Maven home: /opt/apache-maven-3.5.2
Java version: 10-ea, vendor: Oracle Corporation
Java home: /opt/jdk-10
Default locale: en_DK, platform encoding: UTF-8
OS name: "linux", version: "4.14.14", arch: "amd64", family: "unix"

Java version:

java 10-ea 2018-03-20
Java(TM) SE Runtime Environment 18.3 (build 10-ea+42)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10-ea+42, mixed mode)
...
            <plugin>                                                            
                <artifactId>maven-compiler-plugin</artifactId>                  
                <version>3.7.0</version>                                        
                <configuration>                                                 
                    <source>10</source>                                         
                    <target>10</target>                                                     
                    <compilerArgs>                                              
                        <arg>-Xlint:all,-processing,-cast,-serial,-try</arg>                                                    
                    </compilerArgs>                                             
                    <showWarnings>true</showWarnings>                           
                    <showDeprecation>true</showDeprecation>                     
                </configuration>                                                
            </plugin>                                                           
...

And the maven build fails with:

[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ manager-api ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 214 source files to /home/target/classes
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by lombok.javac.apt.LombokProcessor to field com.sun.tools.javac.processing.JavacProcessingEnvironment.discoveredProcs
WARNING: Please consider reporting this to the maintainers of lombok.javac.apt.LombokProcessor
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
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.265 s
[INFO] Finished at: 2018-02-05T10:16:24+01:00
[INFO] Final Memory: 54M/197M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project manager-api: Fatal error compiling: java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTags -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project manager-api: Fatal error compiling
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Fatal error compiling
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1086)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.codehaus.plexus.compiler.CompilerException: java.lang.ExceptionInInitializerError
    at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:173)
    at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1075)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.RuntimeException: java.lang.ExceptionInInitializerError
    at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions (JavacTaskImpl.java:158)
    at com.sun.tools.javac.api.JavacTaskImpl.doCall (JavacTaskImpl.java:96)
    at com.sun.tools.javac.api.JavacTaskImpl.call (JavacTaskImpl.java:90)
    at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:126)
    at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1075)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.ExceptionInInitializerError
    at lombok.javac.handlers.HandleGetter.<clinit> (HandleGetter.java:303)
    at java.lang.Class.forName0 (Native Method)
    at java.lang.Class.forName (Class.java:374)
    at lombok.core.SpiLoadUtil$1$1.next (SpiLoadUtil.java:111)
    at lombok.javac.HandlerLibrary.loadAnnotationHandlers (HandlerLibrary.java:171)
    at lombok.javac.HandlerLibrary.load (HandlerLibrary.java:156)
    at lombok.javac.JavacTransformer.<init> (JavacTransformer.java:44)
    at lombok.javac.apt.LombokProcessor.init (LombokProcessor.java:89)
    at lombok.core.AnnotationProcessor$JavacDescriptor.want (AnnotationProcessor.java:87)
    at lombok.core.AnnotationProcessor.init (AnnotationProcessor.java:140)
    at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.init (AnnotationProcessor.java:69)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init> (JavacProcessingEnvironment.java:674)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next (JavacProcessingEnvironment.java:771)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs (JavacProcessingEnvironment.java:866)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2100 (JavacProcessingEnvironment.java:110)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run (JavacProcessingEnvironment.java:1202)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing (JavacProcessingEnvironment.java:1311)
    at com.sun.tools.javac.main.JavaCompiler.processAnnotations (JavaCompiler.java:1250)
    at com.sun.tools.javac.main.JavaCompiler.compile (JavaCompiler.java:928)
    at com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0 (JavacTaskImpl.java:100)
    at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions (JavacTaskImpl.java:142)
    at com.sun.tools.javac.api.JavacTaskImpl.doCall (JavacTaskImpl.java:96)
    at com.sun.tools.javac.api.JavacTaskImpl.call (JavacTaskImpl.java:90)
    at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:126)
    at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1075)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.code.TypeTags
    at java.lang.ClassLoader.findClass (ClassLoader.java:711)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:566)
    at lombok.launch.ShadowClassLoader.loadClass (ShadowClassLoader.java:422)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:499)
    at java.lang.Class.forName0 (Native Method)
    at java.lang.Class.forName (Class.java:291)
    at lombok.javac.JavacTreeMaker$SchroedingerType.getFieldCached (JavacTreeMaker.java:156)
    at lombok.javac.JavacTreeMaker$TypeTag.typeTag (JavacTreeMaker.java:245)
    at lombok.javac.Javac.<clinit> (Javac.java:155)
    at lombok.javac.handlers.HandleGetter.<clinit> (HandleGetter.java:303)
    at java.lang.Class.forName0 (Native Method)
    at java.lang.Class.forName (Class.java:374)
    at lombok.core.SpiLoadUtil$1$1.next (SpiLoadUtil.java:111)
    at lombok.javac.HandlerLibrary.loadAnnotationHandlers (HandlerLibrary.java:171)
    at lombok.javac.HandlerLibrary.load (HandlerLibrary.java:156)
    at lombok.javac.JavacTransformer.<init> (JavacTransformer.java:44)
    at lombok.javac.apt.LombokProcessor.init (LombokProcessor.java:89)
    at lombok.core.AnnotationProcessor$JavacDescriptor.want (AnnotationProcessor.java:87)
    at lombok.core.AnnotationProcessor.init (AnnotationProcessor.java:140)
    at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.init (AnnotationProcessor.java:69)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init> (JavacProcessingEnvironment.java:674)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next (JavacProcessingEnvironment.java:771)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs (JavacProcessingEnvironment.java:866)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2100 (JavacProcessingEnvironment.java:110)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run (JavacProcessingEnvironment.java:1202)
    at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing (JavacProcessingEnvironment.java:1311)
    at com.sun.tools.javac.main.JavaCompiler.processAnnotations (JavaCompiler.java:1250)
    at com.sun.tools.javac.main.JavaCompiler.compile (JavaCompiler.java:928)
    at com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0 (JavacTaskImpl.java:100)
    at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions (JavacTaskImpl.java:142)
    at com.sun.tools.javac.api.JavacTaskImpl.doCall (JavacTaskImpl.java:96)
    at com.sun.tools.javac.api.JavacTaskImpl.call (JavacTaskImpl.java:90)
    at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:126)
    at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:174)
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1075)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:168)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)

@krzyk
Copy link
Contributor Author

krzyk commented Feb 5, 2018

When I do:

            <plugin>                                                            
                <artifactId>maven-compiler-plugin</artifactId>                  
                <version>3.7.0</version>                                        
                <configuration>                                                 
                    <source>10</source>                                         
                    <target>10</target>                                         
                    <fork>true</fork>                                           
                    <compilerArgs>                                              
                        <arg>-Xlint:all,-processing,-cast,-serial,-try</arg>                                        
                                    <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>                                                               
                                    <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
                                    <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
                                    <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
                                    <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
                                    <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
                                    <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
                                    <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
                                    <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
                                    <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED</arg>
                                    <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
                                    <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
                    </compilerArgs>                                             
                    <showWarnings>true</showWarnings>                           
                    <showDeprecation>true</showDeprecation>                     
                </configuration>                                                
            </plugin>                                

I get a different error messages with problematic __:

[ERROR]   symbol: class __
[ERROR] /home/data/CreateNewKeyCollectionCommandHandler.java:[15,42] error: cannot find symbol

Probably because of:

@RequiredArgsConstructor(onConstructor = @__(@Autowired))

@yurii-polishchuk
Copy link

Did you tried this one for @Autowired?

from JDK8:

@RequiredArgsConstructor(onConstructor_={@AnnotationsGohere}) // note the underscore after onConstructor.

@krzyk
Copy link
Contributor Author

krzyk commented Feb 5, 2018

@yurii-polishchuk Actually I did it other way, I just removed the @Autowired annotation (I don't need it as I have only 1 constructor).
But after that I get errors which I don't know if are a result of lombok or query-dsl (which I use) or maven-compiler 3.7.0:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.212 s
[INFO] Finished at: 2018-02-05T11:06:02+01:00
[INFO] Final Memory: 35M/127M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project manager-api: Compilation failure: Compilation failure: 
[ERROR] bad path element "/home/data/.m2/repository/org/glassfish/jaxb/jaxb-core/2.3.0/istack-commons-runtime-3.0.5.jar": no such file or directory
[ERROR] /home/data/dev/manager-api/src/main/java/com/apikeymanager/domain/tapioca/repository/ChangeEventJPAProvider.java:[10,53] error: cannot find symbol
[ERROR]   symbol:   class QChangeEvent
[ERROR]   location: package com.apikeymanager.domain.tapioca
[ERROR] /home/data/dev/manager-api/src/main/java/com/apikeymanager/domain/tapioca/repository/ChangeEventJPAProvider.java:[10] error: static import only from classes and interfaces
[ERROR] /home/data/dev/manager-api/src/main/java/com/apikeymanager/domain/collection/repository/KeyCollectionJPAProvider.java:[21,56] error: cannot find symbol

@krzyk
Copy link
Contributor Author

krzyk commented Feb 6, 2018

OK, I've created a minimal working example of problem with JDK 10 at https://github.com/krzyk/lombok-jdk10-example

doing mvn clean verify on the above in JDK 10 results in:

[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ lombok-jdk10 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /home/dev/moje/lombok-jdk10/target/classes
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by lombok.javac.apt.LombokProcessor to field com.sun.tools.javac.processing.JavacProcessingEnvironment.discoveredProcs
WARNING: Please consider reporting this to the maintainers of lombok.javac.apt.LombokProcessor
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
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/dev/moje/lombok-jdk10/src/main/java/com/kirela/lombok/Bar.java:[5,18] cannot find symbol
  symbol:   method setBar(java.lang.String)
  location: class com.kirela.lombok.Foo
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.058 s
[INFO] Finished at: 2018-02-06T14:07:16+01:00
[INFO] Final Memory: 16M/60M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project lombok-jdk10: Compilation failure
[ERROR] /home/dev/moje/lombok-jdk10/src/main/java/com/kirela/lombok/Bar.java:[5,18] cannot find symbol
[ERROR]   symbol:   method setBar(java.lang.String)
[ERROR]   location: class com.kirela.lombok.Foo
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

So lombok is not generating getters at all, I tested with Builder and NoArgsContructor, same behavior.

I also tried with fork=true and compilerArgs that worked in JDK 9 (contained in the pom.xml inside mentioned project).

@rspilker
Copy link
Collaborator

rspilker commented Feb 6, 2018

Can someone create java-10.sh in https://github.com/rzwitserloot/lombok/tree/master/docker/provision/jdk to speed up the development process?

And possibly add a pom file, similar to the one in https://github.com/rzwitserloot/lombok/tree/master/docker/maven/files/jdk-9

@rzwitserloot
Copy link
Collaborator

I doubt it'll work, but (tip from ##java's Maldivia): if we add to lombok's manifest:
Add-Exports: module/package=ALL-UNNAMED

@Maldivia
Copy link

Maldivia commented Feb 6, 2018

the javac version "10-ea" doesn't match VERSION_PARSER in Javac.java
Similar, the "JDK10" enum name in Sources doesn't match the SOURCE_PARSER pattern.

Meaning it falls back to version 6, so it ends up looking for TypeTags instead of TypeTag.

@rspilker
Copy link
Collaborator

rspilker commented Feb 7, 2018

We've improved the version parsing. This might have fixed the TypeTags problem.

Can you test this using the edge release?

@rspilker
Copy link
Collaborator

rspilker commented Feb 7, 2018

We still need to have a look at the __ trick.

@krzyk
Copy link
Contributor Author

krzyk commented Feb 7, 2018

@rspilker Tried edge release and I get same error (the only difference is lack of "WARNING" for LombockProcessor:

[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ lombok-jdk10 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /home/dev/moje/lombok-jdk10/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/dev/moje/lombok-jdk10/src/main/java/com/kirela/lombok/Bar.java:[5,18] cannot find symbol
  symbol:   method setBar(java.lang.String)
  location: class com.kirela.lombok.Foo
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.955 s
[INFO] Finished at: 2018-02-07T20:06:48+01:00
[INFO] Final Memory: 16M/64M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project lombok-jdk10: Compilation failure
[ERROR] /home/dev/moje/lombok-jdk10/src/main/java/com/kirela/lombok/Bar.java:[5,18] cannot find symbol
[ERROR]   symbol:   method setBar(java.lang.String)
[ERROR]   location: class com.kirela.lombok.Foo
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

@tmurakam
Copy link
Contributor

tmurakam commented Feb 12, 2018

The edge release is worked for me with maven build of my project.
But it does not work with IntelliJ build.

Warning:(35, 8) java: lombok.javac.apt.LombokProcessor could not be initialized. Lombok will not run during this compilation: java.lang.IllegalArgumentException: com.sun.tools.javac.main.DelegatingJavaFileManager$DelegatingSJFM extends com.sun.tools.javac.main.DelegatingJavaFileManager implements javax.tools.StandardJavaFileManager
             at lombok.javac.apt.LombokFileObjects.getCompiler(LombokFileObjects.java:148)
             at lombok.javac.apt.InterceptingJavaFileManager.<init>(InterceptingJavaFileManager.java:40)
             at lombok.javac.apt.LombokProcessor.placePostCompileAndDontMakeForceRoundDummiesHook(LombokProcessor.java:165)
            (...snip...)

I think we need to add "com.sun.tools.javac.main.DelegatingJavaFileManager$DelegatingSJFM" to
LombokFileObjects.KNOWN_JAVA9_FILE_MANAGERS.

tmurakam added a commit to tmurakam/lombok that referenced this issue Feb 22, 2018
add jdk10.sh to download openjdk10+44 EA.
update jdk 9.0.1 -> 9.0.4
@eolivelli
Copy link

Is there any way to use 'edge' release with Maven without installing hte jar locally, that is some kind of snapshots repository ?

Are you planning a release which supports JDK10 ?

thank you

@krzyk
Copy link
Contributor Author

krzyk commented Mar 13, 2018

Have you got any idea why my example project (https://github.com/krzyk/lombok-jdk10-example) doesn't work with Lombok edge release and JDK 10?
It looks really simple so there are no issues from other libraries for sure there.

@krzyk
Copy link
Contributor Author

krzyk commented Mar 20, 2018

JDK 10 is GA - http://www.oracle.com/technetwork/java/javase/downloads/index.html

@myashchenko
Copy link

myashchenko commented Mar 20, 2018

Have the same problem with Gradle build. When do you plan to release new version?

tmurakam added a commit to tmurakam/lombok that referenced this issue Mar 21, 2018
tmurakam added a commit to tmurakam/lombok that referenced this issue Mar 21, 2018
Add a JavaFileManager class name to KNOWN_JAVA9_FILE_MANAGERS.
@tmurakam
Copy link
Contributor

tmurakam commented Mar 21, 2018

I sent a pull request(#1620) to support IntelliJ build with JDK10.

@krzyk
Copy link
Contributor Author

krzyk commented Mar 21, 2018

@tmurakam does it help with maven/gradle build also?

@tmurakam
Copy link
Contributor

@krzyk I can compile your project with my patch using maven.

@rasenderhase
Copy link

related to #524 ?

@rzwitserloot
Copy link
Collaborator

Building lombok itself on jdk10 didn't work because ecj isn't really compatible with it, but, hey, managed to work around it.

lombok itself on jdk10 seems to work fine for me; that's with javac on the command line.

Gonna integrate @tmurakam excellent work on this and push out an edge release.

@MCMicS
Copy link

MCMicS commented Aug 24, 2018

with JDK 10 you will get following error:

[loading /modules/java.base/java/lang/Deprecated.class]
[loading /modules/java.base/java/lang/annotation/Target.class]
[loading /modules/java.base/java/lang/annotation/ElementType.class]
[loading /modules/java.base/java/lang/annotation/Retention.class]
[loading /modules/java.base/java/lang/annotation/RetentionPolicy.class]
[loading /modules/java.base/java/lang/annotation/Annotation.class]
Round 1:
        input files: {com.intive.Main, com.intive.Company}
        annotations: [lombok.Data]
        last round: false
[search path for source files: \repo\org\mapstruct\mapstruct-processor\1.2.0.Final\mapstruct-processor-1.2.0.Final.jar,.]
[search path for class files: \repo\org\mapstruct\mapstruct-processor\1.2.0.Final\mapstruct-processor-1.2.0.Final.jar,.]
Processor lombok.launch.AnnotationProcessorHider$AnnotationProcessor matches [lombok/lombok.Data] and returns true.
[parsing started lombok.javac.apt.EmptyLombokFileObject@4285cbaa]
[parsing completed 7ms]
[loading /modules/java.base/java/lang/SuppressWarnings.class]
[loading /modules/java.base/java/lang/Override.class]
Round 2:
        input files: {}
        annotations: []
        last round: true
/lombok/dummy/ForceNewRound0.java:1: error: file should be on source path, or on patch path for module
[total 1230ms]
1 error

see also #1723

@MCMicS
Copy link

MCMicS commented Aug 25, 2018

may it's a lombok-maven-plugin problem.
If you remove the plugin and and add following, the processors will be called but ends with the ForceNewRound0.java error

                    <compilerArgs>
                        <arg>--processor-module-path</arg>
                        <arg>\repo\org\projectlombok\lombok\${org.projectlombok.version}\lombok-${org.projectlombok.version}.jar;P:\Maven Repository\repo\org\mapstruct\mapstruct-processor\1.2.0.Final\mapstruct-processor-1.2.0.Final.jar;</arg>
                        <arg>-verbose</arg>
                        <arg>-XprintRounds</arg>
                        <arg>-XprintProcessorInfo</arg>
                        <arg>-Xlint</arg>
                        <arg>-J-verbose</arg>
                    </compilerArgs>

Sample found here: https://github.com/MCMicS/lombok-examples/blob/15772-without-lombok-maven/pom.xml

@MCMicS
Copy link

MCMicS commented Oct 17, 2018

Still occurs with latest Edge Release

@apatil88
Copy link

apatil88 commented Mar 18, 2019

I posted a fix for this issue using Gradle at: https://stackoverflow.com/questions/55227728/cannot-find-symbol-error-lombok-1-18-6-does-not-work-with-gradle-5-2-1-jdk-10

Thanks.

@jonasespelita
Copy link

Seems to work with 1.18.8.

@samwebber11
Copy link

just try it with Java version 1.8 and also with lombok version 1.16.18.. It should work out.
What happening behind is that lombok is a getter setter for java and sometimes that is not compatible for versions or u need to setup the versions manually so just try for these verisons it must work out

@audtjddld
Copy link

Thx~~ 1.18.8 nice

@Paromita23
Copy link

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.576 s
[INFO] Finished at: 2020-03-07T21:32:36+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project MLP178: Fatal error compiling: java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTags -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

@rzwitserloot
Copy link
Collaborator

@Paromita23 I'm not sure that's actually relevant to this particular issue. If you're still running into this with lombok 1.18.12, open a new bug report, do use the -e/-X switches (because without an actual stack trace or a test project to reproduce this error, it's not possible for us to fix it, of course), and include a test project so we can reproduce it.

@samwebber11
Copy link

@Paromita23 I think this is not a issue related to lombok version or your jdk version. So you must raise the issue or give the exact versions you are using for this project.

@vipup
Copy link

vipup commented Mar 20, 2020

at least 2-years BUG 8-)
...that 2 seconds, what should be saved with lombok take aprox 2 year for many-many-many developers to fix it! 👍
Nice job! 💯 🤣

@Talk2Harish
Copy link

use this

<dependency>
    <groupId>org.jboss.openjdk-orb</groupId>
    <artifactId>openjdk-orb</artifactId>
    <version>8.1.1.Final</version>
</dependency>

zhangmx added a commit to zhangmx/shardingsphere that referenced this issue Nov 21, 2020
update lombok version for win10 compile error projectlombok/lombok#1572
terrymanu pushed a commit to apache/shardingsphere that referenced this issue Nov 21, 2020
update lombok version for win10 compile error projectlombok/lombok#1572
abysscat-yj pushed a commit to abysscat-yj/shardingsphere that referenced this issue Nov 21, 2020
…o Collection type.

update lombok version for win10 compile error projectlombok/lombok#1572
abysscat-yj pushed a commit to abysscat-yj/shardingsphere that referenced this issue Nov 21, 2020
…o Collection type.

update lombok version for win10 compile error projectlombok/lombok#1572
Zhoutzzz pushed a commit to Zhoutzzz/shardingsphere that referenced this issue Dec 2, 2020
update lombok version for win10 compile error projectlombok/lombok#1572
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