Closed mdennis10 closed 5 years ago
You must run Retrolambda using Java 8. The easiest way is to run Maven under Java 8, but you can also configure retrolambda-maven-plugin's java8home parameter. The tests you may run with Java 7 by setting the <jvm>
parameter of maven-surefire-plugin/maven-failsafe-plugin.
I have a maven project that I'm compiling using java 7. The project builds fine with anonymous inner classes, however I want to use lambda with backward compatibility. When I change my anonymous inner classes and builds the project everything works fine but when I add the maven plug-in I get the following error:
main: [exec] FATAL ERROR in native method: processing of -javaagent failed [exec] java.lang.UnsupportedClassVersionError: net/orfjackal/retrolambda/PreMain : Unsupported major.minor version 52.0 [exec] at java.lang.ClassLoader.defineClass1(Native Method) [exec] at java.lang.ClassLoader.defineClass(ClassLoader.java:800) [exec] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [exec] at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) [exec] at java.net.URLClassLoader.access$100(URLClassLoader.java:71) [exec] at java.net.URLClassLoader$1.run(URLClassLoader.java:361) [exec] at java.net.URLClassLoader$1.run(URLClassLoader.java:355) [exec] at java.security.AccessController.doPrivileged(Native Method) [exec] at java.net.URLClassLoader.findClass(URLClassLoader.java:354) [exec] at java.lang.ClassLoader.loadClass(ClassLoader.java:425) [exec] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) [exec] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) [exec] at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:300) [exec] at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:397) [exec] Exception in thread "main"