编程语言
首页 > 编程语言> > 无法确定’9.0.1’中的java版本

无法确定’9.0.1’中的java版本

作者:互联网

尝试上传项目到bintray,只是得到错误:

无法从’9.0.1’确定java版本.

我读到了它的等级错误,它修复了上层版本,我试过了
将gradle版本更改为4.2.1,但得到另一个错误:

Gradle sync failed: No such property: FOR_RUNTIME for class:
org.gradle.api.attributes.Usage Consult IDE log for more details
(Help | Show Log) (571ms)

Gradle属性:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-all.zip

建立gradle项目

buildscript {
    ext.kotlin_version = '1.1.51'

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-beta7'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.novoda:bintray-release:0.5.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

解决方法:

您还应该删除Java JDK.只需运行以下命令:

> cd / Library / Java / JavaVirtualMachines
> sudo rm -rf jdk1

现在检查终端中输入’java’.

有关更多参考资料,请参阅此处:https://www.howtogeek.com/230145/how-to-uninstall-java-on-mac-os-x/

标签:android,java,gradle,bintray
来源: https://codeday.me/bug/20190926/1818541.html