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

Delombok fails with Java 7 #495

Closed
lombokissues opened this issue Jul 14, 2015 · 9 comments
Closed

Delombok fails with Java 7 #495

lombokissues opened this issue Jul 14, 2015 · 9 comments
Assignees
Milestone

Comments

@lombokissues
Copy link

Migrated from Google Code (issue 422)

@lombokissues
Copy link
Author

👤 anthony@whitford.com   🕗 Oct 21, 2012 at 17:32 UTC

A bunch of people are complaining that the lombok-maven-plugin does not work with Java 7. Sure enough, I get the following exception:

java.lang.VerifyError: (class: lombok/delombok/Delombok, method: delombok signature: ()Z) Incompatible argument to function
at lombok.maven.AbstractDelombokMojo.execute(AbstractDelombokMojo.java:102)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

The above is with Maven 2.2.1, 64-bit Java 7 update 9, on Windows 7. I get a similar exception with Maven 3.0.4.

Line 102:
https://github.com/awhitford/lombok.maven/blob/master/lombok-maven-plugin/src/main/java/lombok/maven/AbstractDelombokMojo.java﹟L102
simply calls:
final Delombok delombok = new Delombok();

I understand that earlier versions worked fine with Java 7 -- but it failed around 0.11.0 or 0.11.2 and continues with 0.11.4.

@lombokissues
Copy link
Author

👤 anthony@whitford.com   🕗 Oct 21, 2012 at 17:51 UTC

If I do this first:
set MAVEN_OPTS=-noverify
then try 'mvn clean install' again, I get a different error:

[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] com.sun.tools.javac.main.JavaCompiler.attribute(Lcom/sun/tools/javac/util/ListBuffer;)Lcom/sun/tools/javac/util/List;
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.NoSuchMethodError: com.sun.tools.javac.main.JavaCompiler.attribute(Lcom/sun/tools/javac/util/ListBuffer;)Lcom/sun/tools/javac/util/List;
at lombok.delombok.Delombok.delombok(Delombok.java:384)
at lombok.maven.AbstractDelombokMojo.execute(AbstractDelombokMojo.java:121)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

@lombokissues
Copy link
Author

👤 anthony@whitford.com   🕗 Oct 21, 2012 at 17:56 UTC

A link to the Java 7 report against lombok-maven-plugin: awhitford/lombok.maven#11

@lombokissues
Copy link
Author

👤 reinierz   🕗 Oct 22, 2012 at 07:52 UTC

Yup, thanks. Fixed in master: bde859c

Also rolled out an edge release so you can test that the fix works.

Could you let us know if the edge build fixes this for you?

https://projectlombok.org/download-edge.html

NB: The current trunk is a mess, test wise. I fixed the issue where tests fail horribly if your local JRE does not match up to the javac6.jar we compile against, but now other discrepancies show up. We'll need to rewrite the test code to be more heuristic, or more likely, just do some regexp fu or something. We'll get there. At any rate, you can test against more things, but, there are more errors in the tests. Something to fix for tonight. None of this has an effect on lombok itself, just on running the lombok test suite.

@lombokissues
Copy link
Author

👤 anthony@whitford.com   🕗 Oct 26, 2012 at 06:57 UTC

Confirmed that this version works with Java 7 on Windows.

@lombokissues
Copy link
Author

👤 anthony@whitford.com   🕗 Oct 26, 2012 at 07:03 UTC

And I also confirmed that this version works with Java 6 on a Mac.

Thank you!

(When will this version be officially released?)

@lombokissues
Copy link
Author

👤 reinierz   🕗 Oct 26, 2012 at 10:41 UTC

Sweet! Marking this one down as verified.

@lombokissues
Copy link
Author

👤 reinierz   🕗 Oct 30, 2012 at 00:09 UTC

Now officially released in lombok v0.11.6.

@lombokissues lombokissues modified the milestones: 0.11.5, 0.11.6 Jul 14, 2015
@lombokissues
Copy link
Author

End of migration

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

2 participants