Dear Gradle, Why So Stubborn?
Do I do something wrong?

Watching juniors try to set up a project and being greeted by cryptic stack traces like it's some kind of initiation ritual.

`Unsupported class file major version 61`
`invalid CEN header zip64 no access package`, ...

Java can compile code for older versions just fine.
It's literally designed for that.
Oh why, must Gradle behave like a bitter librarian who refuses to hand over a book unless I whisper the exact Dewey Decimal Code?
Every other Language will laugh again at java, seeing this.

💡 Why is Gradle bound to a java version? And if Gradle knows it needs Java 11… why doesn't it just do this for me?
Like using `/usr/libexec/java_home -v 11` in background?

🤖 Is there a clean way to force Gradle into submission without adding another tool like SDKMAN or jabba or YunaBraska/gradle-java-fix or whatever the trendy painkiller of the week is?

#Java #Gradle #BuildTools #DevHumor #DeveloperProblems #JDK #ProgrammingPain #CleanCode #SoftwareEngineering #OpenJDK #CodeNewbie #BackendDev #BuildFails

@LunaFreyja Gradle currently requires Java >= 8 and tries hard to produce meaningful error messages when launched with 6 or 7. Third parties plugins might require different java version though, for reasons ... :/ Gradle again tries to be mindfull in such cases but we might have missed some. Hard to tell what you are facing without knowing more.
@eskatos no idea what I do wrong, I always get “Unsupported class file major version” whenever I have a newer Java version and need to set my Java home to exactly the Java version which build.gradle has defined for compilation. Really annoying.
@LunaFreyja I bet you're not doing anything wrong, all the tools involved should make a better job at telling you what exactly is happening