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

Fails with JDK7 #134

Closed
lombokissues opened this Issue Jul 14, 2015 · 8 comments

Comments

Projects
None yet
2 participants
@lombokissues
Collaborator

lombokissues commented Jul 14, 2015

Migrated from Google Code (issue 61)

@lombokissues

This comment has been minimized.

Collaborator

lombokissues commented Jul 14, 2015

👤 jacek99   🕗 Oct 13, 2009 at 19:48 UTC

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

@lombokissues

This comment has been minimized.

Collaborator

lombokissues commented Jul 14, 2015

👤 jacek99   🕗 Oct 13, 2009 at 19:49 UTC

Updated my JDK to latest build of JDK7, re-run my project from Maven
got the following exception:

java.lang.NoSuchMethodError:
com.sun.tools.javac.util.Name$Table.instance(Lcom/sun/tools/javac/util/Context;)Lcom/sun/tools/javac/util/Name$Table;
at lombok.javac.JavacAST.(JavacAST.java:78)
at lombok.javac.apt.Processor.process(Processor.java:97)
at
com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:775)
at
com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:704)
at
com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:849)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1070)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:805)
at com.sun.tools.javac.main.Main.compile(Main.java:400)
at com.sun.tools.javac.main.Main.compile(Main.java:318)
at com.sun.tools.javac.main.Main.compile(Main.java:309)
at com.sun.tools.javac.Main.compile(Main.java:100)
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:617)
at
org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:420)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:141)
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:493)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
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.forkProjectLifecycle(DefaultLifecycleExecutor.java:1205)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:1038)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:643)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
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:617)
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

This comment has been minimized.

Collaborator

lombokissues commented Jul 14, 2015

👤 reinierz   🕗 Oct 16, 2009 at 09:55 UTC

Yup, because sun changed a bunch of API, we can't be compatible with both 6 and 7.

At some point we'll have to put in quite a bit of annoying logic to detect whether you're on 6 or 7, and do
different patching depending on which version you're on.

I guess we're going to have to address this sooner rather than later, as JDK7 is coming. Issue accepted.

@lombokissues

This comment has been minimized.

Collaborator

lombokissues commented Jul 14, 2015

👤 jacek99   🕗 Oct 16, 2009 at 10:52 UTC

Don't shoot me, I'm just the messenger :-)

@lombokissues

This comment has been minimized.

Collaborator

lombokissues commented Jul 14, 2015

👤 lahoda   🕗 Nov 27, 2009 at 10:31 UTC

I am attaching a patch that fixes the NoSuchMethodError (should be compatible with
both JDK6 and JDK7 javac). A did a very quick test, and Lombok worked OK on JDK7m5
javac with this patch (I did not do any rigorous testing though). Note that support
for JDK7 javac is a prerequisite for NetBeans support.

Also note that Lombok does not compile using JDK7 for several reasons (e.g.
specifying target="1.5", but not specifying source="1.5" - works for JDK6, because
default source level for JDK6 is still "1.5", but for JDK7, the default source level
is "1.7"). Not important for NetBeans support though.

@lombokissues

This comment has been minimized.

Collaborator

lombokissues commented Jul 14, 2015

👤 lahoda   🕗 Nov 27, 2009 at 10:31 UTC

🔗 no-nametable.diff View file

@lombokissues

This comment has been minimized.

Collaborator

lombokissues commented Jul 14, 2015

👤 reinierz   🕗 Nov 27, 2009 at 11:31 UTC

Wow. sweet! I'll take your word for it for now. We'll doublecheck this for v0.9.2. Thanks a ton, lahoda!

I fixed the buildscripts to add source= in all the tasks. There was also a circular dependency in the
2-phase compile process (the javac-specific bits are source/target 1.6, but core and eclipse is 1.5 in order for
lombok to run on eclipses being started on JVM1.5, which happens in plenty of places, including 99% of all
eclipses running on Mac 10.5 Leopard).

It's on the github master branch now, commits:

44d6a6b
fb71e1b

@lombokissues

This comment has been minimized.

Collaborator

lombokissues commented Jul 14, 2015

End of migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment