gradle-retrolambda icon indicating copy to clipboard operation
gradle-retrolambda copied to clipboard

Error using frameworks compiled with Java 8 to test pure java projects

Open jbrunton opened this issue 9 years ago • 4 comments

Hi,

I have an Android project with a pure java (i.e. not Android) project dependency. I'm using AssertJ, version 3 of which is compiled using Java 8, for unit tests. I have all the relevant JAVA*_HOME variables set, and gradle is running using Java 8.

What I observe:

  • I can run the unit tests for the Android project just fine from both Android Studio and the command line.
  • The unit tests for the library project run fine from Android Studio.
  • The unit tests for the library project fail when I run them from the command line with java.lang.UnsupportedClassVersionError: org/assertj/core/api/Assertions : Unsupported major.minor version 52.0.

I have an example project here. For me, running ./gradlew lib:test will induce the failure.

Can you provide any advice? I've already taken all the steps suggested in other issues which mention this error (e.g. #133).

Great work on this project btw.

jbrunton avatar Jan 03 '16 16:01 jbrunton

I have this same issue. Did you figure anything out?

Arnesen avatar Mar 17 '16 13:03 Arnesen

@Arnesen Unfortunately not, although I haven't had a chance to look at this for a while.

jbrunton avatar Mar 30 '16 16:03 jbrunton

Unsupported major.minor version 52.0 usually indicates that whatever you're trying to run there needs Java 8 and you're not running it with Java 8.

vanniktech avatar Mar 30 '16 16:03 vanniktech

I just ran into this exact issue.

hmvien avatar May 23 '16 22:05 hmvien