Adding Lombok to Eclipse annotation processors leads to Internal Compiler Error #126

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

Projects

None yet

2 participants

@lombokissues
Collaborator

Migrated from Google Code (issue 53)

@lombokissues
Collaborator

๐Ÿ‘ค jorn86 ย  ๐Ÿ•— Sep 19, 2009 at 20:17 UTC

I added the Lombok annotation processor to a project in Eclipse. It's a
very simple project, consisting of only one file with only one annotation
used. I now have an error on line 0 saying it doesn't work (see below for
stacktrace). There's also an error saying my final fields aren't
initialized, so the processor obviously isn't running.

Internal compiler error java.lang.NoClassDefFoundError:
com/sun/tools/javac/processing/
JavacProcessingEnvironment at
lombok.javac.apt.Processor.init(Processor.java:74) at
org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcesso
rManager.discoverNextProcessor(IdeA
nnotationProcessorManager.java:93) at
org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(Round
Dispatcher.java:116) at
org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorMana
ger.processAnnotations(BaseAnnota
tionProcessorManager.java:159) at
org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcesso
rManager.processAnnotations(IdeAnn
otationProcessorManager.java:134) at
org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.jav
a:794) at
org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:423) at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(Abstrac
tImageBuilder.java:363) at
org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImage
Builder.java:178) at
org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(Abstrac
tImageBuilder.java:300) at
org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBu
ilder.java:60) at
org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.jav
a:254) at
org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:1
73) at
org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
at
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java
:170) at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java
:201) at
org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
at
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java
:256) at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java
:218) at
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:360)
at
org.eclipse.core.internal.resources.Project.internalBuild(Project.java:516
) at
org.eclipse.core.internal.resources.Project.build(Project.java:94) at
org.eclipse.jdt.internal.ui.util.CoreUtility
$BuildJob.run(CoreUtility.java:160) at
org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Caused by:
java.lang.ClassNotFoundException:
com.sun.tools.javac.processing.JavacProcessingEnvironment at
java.net.URLClassLoader$1.run(Unknown Source) at
java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source) at
java.lang.ClassLoader.loadClass(Unknown Source) at
java.lang.ClassLoader.loadClass(Unknown Source) at
java.lang.ClassLoader.loadClassInternal(Unknown
Source) ... 26 more

@lombokissues
Collaborator

๐Ÿ‘ค jorn86 ย  ๐Ÿ•— Sep 19, 2009 at 20:27 UTC

My setup:
Eclipse 3.5
JDK 1.6.0_03
Lombok 0.8.5

@lombokissues
Collaborator

๐Ÿ‘ค reinierz ย  ๐Ÿ•— Sep 21, 2009 at 01:27 UTC

yeah - don't do that. Just run lombok.jar as a java app (double-click it, usually), and install it into eclipse that
way. We could, and probably should, emit some sort of sane warning explaining what you need to do instead of
this archaic error, so I'm accepting this issue for that purpose.

@lombokissues
Collaborator

๐Ÿ‘ค jorn86 ย  ๐Ÿ•— Sep 21, 2009 at 09:30 UTC

Thanks, it's all fine now :)

@lombokissues
Collaborator

๐Ÿ‘ค reinierz ย  ๐Ÿ•— Nov 24, 2009 at 04:41 UTC

Feature suggestion, of giving a non-archaic error on all platforms, and specific instructions on eclipse to install
lombok instead, is now implemented in commit 66d4709 and should
be rolled out in lombok v0.9.2.

@lombokissues lombokissues removed the accepted label Jul 14, 2015
@lombokissues
Collaborator

End of migration

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