I have a Gradle project in Ubuntu. It's written in Java 14. I have the Java 14 JDK installed. When I build it from the command line, everything works, but no one wants to use a command line! When I open it in IntelliJ IDEA, it throws an error:
* Where:
Initialization script '/tmp/ijmapper.gradle`
* What went wrong:
Could not compile initialization script '/tmp/ijmapper.gradle`.
> Startup failed:
General error during semantic analysis: Unsupported class file major version 60.
followed by a long, unhelpful stack trace that says a lot about Groovy. (The project is not a Groovy project; it's a Java project.)
Major version 60 refers to Java 16, which this project is not using. I've already gone into Project Structure and made sure that it's set to use JDK version 14. But the name "ijmapper" suggests that this has something to do with IntelliJ specifically, and this is likely an IDE problem rather than a project problem.
The mapper file simply says:
if(!ext.has('mapPath')) ext.mapPath = { path -> path}
A simple polyfill, in other words.
What's going on here and how can I fix it?