lombok running in ant

1,271 views
Skip to first unread message

Shervin

unread,
Nov 20, 2009, 9:51:47 AM11/20/09
to Project Lombok
Hi.

I have installed lombok for eclipse now, and everything seems to
compile fine. However, my ant script fails to compile, even though I
have put in classpath of ant lib/**jar

Is it something else I have to do to put lombok in classpath of ant?

Reinier Zwitserloot

unread,
Nov 20, 2009, 11:01:53 AM11/20/09
to Project Lombok
Possible problems:

1. You're not actually including the jar file. What kind of error do
you get? Something along the lines of "Setter not found", which would
indicate the jar is simply not included by ant. Double check the
classpath. I always use the following syntax:

lib/**/*.jar

possibly that's the problem.

2. You are including the jar, but annotation processing is off. This
would happen if you're compiling with javac5 or earlier. Use javac6
and make sure there's nothing like -proc:none being passed as
argument.

Shervin

unread,
Nov 20, 2009, 6:06:11 PM11/20/09
to Project Lombok
Hi. Thanks for quick response.

The latter is correct. I am using java5 compiler and I am kind a
forced to use it.
Does lombok support java 5? If yes, what arguments must I pass or what
do I need to do to make it work with Java 5?
I guess it should work because my eclipse uses jdk 5, so it should
only be a matter of setting.

Shervin

Shervin

unread,
Nov 20, 2009, 6:37:19 PM11/20/09
to Project Lombok
When I just tested with java 6 it did compile and build. But I need
java 5 :(

Shervin

Reinier Zwitserloot

unread,
Nov 20, 2009, 8:16:45 PM11/20/09
to Project Lombok
eclipse is an entirely different beast from java5. Lombok will never
work with javac5 due to javac5 being internally very different from
javac6, and not supporting annotation processors at all. It would be
about as much effort to adapt lombok to java5 as adapting it to, say,
netbeans.

Reinier Zwitserloot

unread,
Nov 20, 2009, 8:18:09 PM11/20/09
to Project Lombok
By the way, you can probably use javac6 in a jvm5, and you can
definitely compile jvm5-targetted class files with javac6; use:

-source 1.5 -target 1.5 -bootclasspath /path/to/rt.jar/of/a/jvm5

This should give you the exact same result as a compile with javac5,
except that the compiler machinery of javac6 (which can run lombok) is
used.

On Nov 21, 12:37 am, Shervin <shervin.asg...@gmail.com> wrote:

Shervin

unread,
Nov 21, 2009, 5:03:48 AM11/21/09
to Project Lombok
Thank you. I will give it a go. I hate to ditch lombok because of
this.

Perhaps though I can use the compiled classes from eclipse to build
the EAR? Just to be safe I mean...
Shervin

Reinier Zwitserloot

unread,
Nov 21, 2009, 11:40:39 AM11/21/09
to Project Lombok
Yes, you can absolutely just use eclipse's own .class files. This is
annoying to downright impossible to get right when you use hudson or
some other CI, but if you don't, more power to you. I actually used to
do this for quite a while on a project, because javac's compiler
contained a bug and eclipse's didn't.
Reply all
Reply to author
Forward
0 new messages