[macbook] Could not determine java version from '14.0.2'

Hi, I’m Flutter, Native Android developer so I have Java, Kotlin and Installed. But today I installed MOE plugin into the latest IntelliJ IDEA and created the simple project in the template called “Single View Application”. The problem is that when I try to run it, it shows me the following error:

Error, unable set Sdk.
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '14.0.2'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
Multi-OS Engine module build failed
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '14.0.2'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
Multi-OS Engine module build failed
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '14.0.2'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
Multi-OS Engine module build failed
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '14.0.2'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
Multi-OS Engine module build failed
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '14.0.2'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
Multi-OS Engine module build failed

Any suggestion in how to solve this?

Use jdk 8 as the project jdk instead. Also make sure the jdk for gradle runner is set to jdk 8 as well.

I had the same problem while trying to generate bindings, even though everything was set to JDK 8. I was however running Kotlin 1.3.41 and a really old version of Gradle (4.5.1).

After updating Kotlin:

buildscript {
    ext.kotlin_version = '1.4.21'
    repositories {
        jcenter()
    }
    dependencies {
        classpath group: 'org.multi-os-engine.community', name: 'moe-gradle', version: '1.7.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

dependencies {
    compile fileTree(dir: 'xcode/libs', include: '*.jar')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
compileKotlin {
    kotlinOptions {
        jvmTarget = "1.8"
    }
}

then updating gradle-wrapper.properties:

distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip

the error went away and I could generate bindings.