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

can't transform JavaFX8 #29

Closed
tobium opened this issue Aug 24, 2014 · 4 comments
Closed

can't transform JavaFX8 #29

tobium opened this issue Aug 24, 2014 · 4 comments

Comments

@tobium
Copy link

tobium commented Aug 24, 2014

When I try to transform current JavaFX8 (u-dev) code, I got the following exception:

Error! Failed to transform some classes
java.lang.RuntimeException: java.lang.NoSuchMethodException: no such method: com.sun.javafx.application.LauncherImpl.lambda$launchApplication$48(Class,Class,String[],CountDownLatch)void/invokeStatic
at net.orfjackal.retrolambda.LambdaReifier.reifyLambdaClass(LambdaReifier.java:42)
at net.orfjackal.retrolambda.LambdaUsageBackporter$InvokeDynamicInsnConvertingMethodVisitor.backportLambda(LambdaUsageBackporter.java:165)
at net.orfjackal.retrolambda.LambdaUsageBackporter$InvokeDynamicInsnConvertingMethodVisitor.visitInvokeDynamicInsn(LambdaUsageBackporter.java:154)
at net.orfjackal.retrolambda.asm.ClassReader.readCode(ClassReader.java:1439)
at net.orfjackal.retrolambda.asm.ClassReader.readMethod(ClassReader.java:1017)
at net.orfjackal.retrolambda.asm.ClassReader.accept(ClassReader.java:693)
at net.orfjackal.retrolambda.asm.ClassReader.accept(ClassReader.java:506)
at net.orfjackal.retrolambda.LambdaUsageBackporter.transform(LambdaUsageBackporter.java:22)
at net.orfjackal.retrolambda.Retrolambda$1.transform(Retrolambda.java:42)
at net.orfjackal.retrolambda.BytecodeTransformingFileVisitor.visitFile(BytecodeTransformingFileVisitor.java:25)
at net.orfjackal.retrolambda.BytecodeTransformingFileVisitor.visitFile(BytecodeTransformingFileVisitor.java:11)
at java.nio.file.Files.walkFileTree(Files.java:2670)
at java.nio.file.Files.walkFileTree(Files.java:2742)
at net.orfjackal.retrolambda.Retrolambda.visitFiles(Retrolambda.java:52)
at net.orfjackal.retrolambda.Retrolambda.run(Retrolambda.java:39)
at net.orfjackal.retrolambda.Main.main(Main.java:26)
Caused by: java.lang.NoSuchMethodException: no such method: com.sun.javafx.application.LauncherImpl.lambda$launchApplication$48(Class,Class,String[],CountDownLatch)void/invokeStatic
at java.lang.invoke.MemberName.makeAccessException(MemberName.java:876)
at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:993)
at java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1379)
at java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:776)
at net.orfjackal.retrolambda.Types.toMethodHandle(Types.java:35)
at net.orfjackal.retrolambda.Types.asmToJdkType(Types.java:19)
at net.orfjackal.retrolambda.LambdaReifier.callBootstrapMethod(LambdaReifier.java:106)
at net.orfjackal.retrolambda.LambdaReifier.reifyLambdaClass(LambdaReifier.java:37)
... 15 more
Caused by: java.lang.NoSuchFieldError: method resolution failed
at java.lang.invoke.MethodHandleNatives.resolve(Native Method)
at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:965)
at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:990)
... 21 more
Result: 1

@luontola
Copy link
Owner

The problem appears to be that when net.orfjackal.retrolambda.LambdaUsageBackporter.InvokeDynamicInsnConvertingMethodVisitor#loadClass loads the class that is being transformed, it loads the class from the JRE's lib/ext/jfxrt.jar which contains a different version of the class than you are trying to transform. Please try if removing jfxrt.jar from your JRE fixes this.

I'll have a look at reproducing this with a unit test and creating a workaround.

@luontola
Copy link
Owner

Please build the latest Retrolambda revision and try if it fixes the problem for you.

@tobium
Copy link
Author

tobium commented Aug 24, 2014

The latest retrolambda fixes the problem! Thanks so much!

@luontola
Copy link
Owner

This is now included in Retrolambda 1.6.1

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

No branches or pull requests

2 participants