Lombok + Java 7 = ?

2,574 views
Skip to first unread message

Jason S

unread,
Jul 28, 2011, 9:24:16 AM7/28/11
to project...@googlegroups.com
How does the release of Java 7 (supposed to be today... hmmm....) affect Lombok? If I download JDK7 and the appropriate Eclipse beta-7 support, will Lombok work or will there be issues?

(just trying to plan my upgrade path & schedule)

saki

unread,
Jul 29, 2011, 2:56:36 PM7/29/11
to Project Lombok, Jason S
I've installed jdk7 just today. Eclipse 3.6 + lombok 0.9.2 works.
Latest version of lombok 0.10.0-RC2 throws error (see below)
Maven works with lombok 0.9.3

PS: I'm using only @Getter / @Setter

Exception in thread "main" java.lang.reflect.InvocationTargetException
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
sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:
382)
at
sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:
397)
Caused by: java.lang.UnsupportedOperationException: adding
retransformable transformers is not supported in this environment
at
sun.instrument.InstrumentationImpl.addTransformer(InstrumentationImpl.java:
88)
at lombok.eclipse.agent.EclipsePatcher.runAgent(EclipsePatcher.java:
75)
at lombok.core.Agent.runAgents(Agent.java:56)
at lombok.core.Agent.premain(Agent.java:43)
... 6 more
FATAL ERROR in native method: processing of -javaagent failed
Aborted (core dumped)


Reinier Zwitserloot

unread,
Jul 30, 2011, 4:03:09 PM7/30/11
to project...@googlegroups.com, Jason S
On Monday we'll investigate both issues (that retransformable thing sounds like you're running eclipse on a 1.5 JVM, which should work, but I guess we introduced a retransform someplace.

drzewo

unread,
Jul 31, 2011, 2:51:17 AM7/31/11
to Project Lombok
Same problem here, I'm getting the following, whenever trying to
launch eclipse (and its derivatives - namely sts) on jdk1.7 with
lombok 0.10.0-rc2 (and it *is* jdk1.7).
AFAIR, I've been getting the same on prerelease builds of jdk1.7
(starting around b142 and up to b147 which has been declared GA) but I
just reverted to jdk1.6 / lombok 0.9.x
Please notice, that you need to launch eclipse using its console based
version (eclipsec.exe rather than eclipse.exe or stsc.exe rather than
sts.exe) as well as modify eclipse.ini to use java.exe rather than
javaw.exe in order to observe the stacktrace in the console -
otherwise it gets swallowed.

cheers,
/dd

Reinier Zwitserloot

unread,
Aug 1, 2011, 3:56:50 PM8/1/11
to project...@googlegroups.com
I think Philip fixed this.  We'll roll out an RC3 tonight probably with the fixes.
Message has been deleted

Philipp Eichhorn

unread,
Aug 1, 2011, 5:18:14 PM8/1/11
to Project Lombok
The only way you can get this kind of error (or at least the only way
i could reproduce it) is if you forget to extend the boot-classpath of
eclipse.
So check if your eclipse.ini contains the following lines:

-javaagent:lombok.jar
-Xbootclasspath/a:lombok.jar

drzewo

unread,
Aug 2, 2011, 1:20:59 PM8/2/11
to Project Lombok
On 1 Sie, 23:18, Philipp Eichhorn <peich...@web.de> wrote:
> The only way you can get this kind of error (or at least the only way
> i could reproduce it) is if you forget to extend the boot-classpath of
> eclipse.
> So check if your eclipse.ini contains the following lines:
>
> -javaagent:lombok.jar
> -Xbootclasspath/a:lombok.jar

I'm pretty sure the abovementioned params were in place.
Nevertheless, I double-checked, and indeed they were there - please
find my sts.ini below

<snip>
-vm
C:/Program Files/Java/jdk1.7.0/bin/javaw.exe
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/
org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
-product
com.springsource.sts.ide
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
384M
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xmn128m
-Xms256m
-Xmx768m
-Xss1m
-XX:PermSize=128m
-XX:MaxPermSize=384m
-javaagent:lombok.jar
-Xbootclasspath/a:lombok.jar
</snip>

I thought that due to the fact that the -Xbootclasspath argument is
specified as a relative path, jvm somehow can't find it as some weird
and unexpected working directory for the launched jvm is used. So I
launched stsc.exe from the command line, and it *magically* started.
Tried the same with sts.exe - tough luck, failed. WTF? In both cases
the CWD for sts ans stsc processes were the same - the one the
lombok.jar is placed. I downloaded the RC3 and the problem is gone.
Thanks!

regz
/dd

Philipp Eichhorn

unread,
Aug 2, 2011, 2:36:18 PM8/2/11
to Project Lombok
It's good to hear that it works.
The odd thing is that 0.10.0-RC3 does not contain any changes
affecting this behaviour.
So I'm still kind of lost understanding the cause of this issue.

drzewo

unread,
Aug 2, 2011, 5:15:55 PM8/2/11
to Project Lombok
On 2 Sie, 20:36, Philipp Eichhorn <peich...@web.de> wrote:
> It's good to hear that it works.
> The odd thing is that 0.10.0-RC3 does not contain any changes
> affecting this behaviour.

AFAICS this commit:
https://github.com/rzwitserloot/lombok/commit/deece277342d7186b32df4630036faa4b950d4f6#src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
changes the offending class considerably (line 75 in particular). I
had no more time nor will to dig any deeper.

Bottomline - rc3 just works. Kudos to Reinier.

regz,
/dd

Philipp Eichhorn

unread,
Aug 2, 2011, 7:22:41 PM8/2/11
to Project Lombok
Ahh, makes sense, I totally forgot the cleanup after issue 164 was
fixed.

- Philipp

On 2 Aug., 23:15, drzewo <dominik.drzewie...@gmail.com> wrote:
> On 2 Sie, 20:36, Philipp Eichhorn <peich...@web.de> wrote:
>
> > It's good to hear that it works.
> > The odd thing is that 0.10.0-RC3 does not contain any changes
> > affecting this behaviour.
>
> AFAICS this commit:https://github.com/rzwitserloot/lombok/commit/deece277342d7186b32df46...

Reinier Zwitserloot

unread,
Aug 8, 2011, 5:55:14 PM8/8/11
to project...@googlegroups.com
Yeah, must have been a problem with the bare bones debugger framework thingie we had in RC1 and RC2.
Reply all
Reply to author
Forward
0 new messages