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

breaks on JDK 15 #161

Open
codefromthecrypt opened this issue Sep 27, 2020 · 2 comments
Open

breaks on JDK 15 #161

codefromthecrypt opened this issue Sep 27, 2020 · 2 comments
Labels

Comments

@codefromthecrypt
Copy link

Unfortunately, I'm failing to use JDK 15 even though JDK 14 is fine now.

     [exec] Java HotSpot(TM) 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
     [exec] 00:00 ERROR: Failed to transform java/lang/invoke/InnerClassLambdaMetafactory, cannot enable the Java agent. Please report an issue to Retrolamb
da with full logs. Probably you're running on an unsupported Java version.
     [exec] java.lang.RuntimeException: Could not find the toByteArray call
     [exec]     at net.orfjackal.retrolambda.lambdas.InnerClassLambdaMetafactoryTransformer.transformMetafactory(InnerClassLambdaMetafactoryTransformer.java
:73)
     [exec]     at net.orfjackal.retrolambda.lambdas.InnerClassLambdaMetafactoryTransformer.transform(InnerClassLambdaMetafactoryTransformer.java:22)
     [exec]     at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:246)
     [exec]     at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
     [exec]     at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:563)
     [exec]     at java.instrument/sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)
     [exec]     at java.instrument/sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:167)
     [exec]     at net.orfjackal.retrolambda.PreMain.premain(PreMain.java:22)
     [exec]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [exec]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
     [exec]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [exec]     at java.base/java.lang.reflect.Method.invoke(Method.java:564)
     [exec]     at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
     [exec]     at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
     [exec] Retrolambda 2.5.7
     [exec] 00:00 ERROR: Failed to run Retrolambda
     [exec] java.lang.IllegalStateException: Cannot initialize dumper; unexpected JDK implementation. Please run Retrolambda using the Java agent (enable forking in the Maven plugin).
     [exec]     at net.orfjackal.retrolambda.lambdas.LambdaClassDumper.install(LambdaClassDumper.java:38)
     [exec]     at net.orfjackal.retrolambda.Retrolambda.run(Retrolambda.java:67)
     [exec]     at net.orfjackal.retrolambda.Main.main(Main.java:28)
     [exec]     Suppressed: java.lang.RuntimeException: java.lang.IllegalAccessException: class net.orfjackal.retrolambda.lambdas.LambdaClassDumper cannot access a member of class java.lang.invoke.InnerClassLambdaMetafactory (in module java.base) with modifiers "private static final"
     [exec]             at net.orfjackal.retrolambda.lambdas.LambdaClassDumper.uninstall(LambdaClassDumper.java:48)
     [exec]             at net.orfjackal.retrolambda.lambdas.LambdaClassDumper.close(LambdaClassDumper.java:55)
     [exec]             at net.orfjackal.retrolambda.Retrolambda.run(Retrolambda.java:102)
     [exec]             ... 1 more
     [exec]     Caused by: java.lang.IllegalAccessException: class net.orfjackal.retrolambda.lambdas.LambdaClassDumper cannot access a member of class java.lang.invoke.InnerClassLambdaMetafactory (in module java.base) with modifiers "private static final"
     [exec]             at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:385)
     [exec]             at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:693)
     [exec]             at java.base/java.lang.reflect.Field.checkAccess(Field.java:1096)
     [exec]             at java.base/java.lang.reflect.Field.set(Field.java:791)
     [exec]             at net.orfjackal.retrolambda.lambdas.LambdaClassDumper.uninstall(LambdaClassDumper.java:46)
     [exec]             ... 3 more
     [exec] Caused by: java.lang.RuntimeException: Failed to make a field non-final (private static final java.lang.invoke.ProxyClassesDumper java.lang.invoke.InnerClassLambdaMetafactory.dumper). This known to fail on Java 12 and newer. Prefer using Java 8 or try using the Java agent (fork=true in the Maven plugin).
     [exec]     at net.orfjackal.retrolambda.lambdas.LambdaClassDumper.makeNonFinal(LambdaClassDumper.java:65)
     [exec]     at net.orfjackal.retrolambda.lambdas.LambdaClassDumper.install(LambdaClassDumper.java:32)
     [exec]     ... 2 more
     [exec] Caused by: java.lang.NoSuchFieldException: modifiers
     [exec]     at java.base/java.lang.Class.getDeclaredField(Class.java:2569)
     [exec]     at net.orfjackal.retrolambda.lambdas.LambdaClassDumper.makeNonFinal(LambdaClassDumper.java:60)
     [exec]     ... 3 more

These links might be helpful (or random waste of your time!)..

dusanboskovic/openj9@b62eb85
oracle/graal#2455

@teras
Copy link

teras commented Nov 27, 2020

I have exactly the same issue.

@luontola
Copy link
Owner

luontola commented Nov 27, 2020

Please run Retrolambda using JDK 8. Newer versions are not supported and there are multiple known incompatibilities with them (e.g. this error happens on JDK 12 and higher, IIRC).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants