简体   繁体   English

Gradle IntelliJ添加Java依赖项

[英]Gradle IntelliJ add java dependencies

I have created new Gradle Java project on IntelliJ and added the library like normally do in Android Studio. 我已经在IntelliJ上创建了新的Gradle Java项目,并像通常在Android Studio中一样添加了库。

Gradle is not getting the library and compiling it. Gradle没有获取库并进行编译。

在此处输入图片说明

Build file. 生成文件。

group 'asynjava'
version '1.0-SNAPSHOT'

apply plugin: 'java'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {

    testCompile group: 'junit', name: 'junit', version: '4.12'

    compile "io.reactivex.rxjava2:rxjava:2.x.y"

}

I couldn't import the library inside my java files. 我无法将库导入我的Java文件中。 Is there any settings I have missed ? 有没有我错过的设置?

compile 'io.reactivex.rxjava2:rxjava:2.1.2'

您必须指定完整的版本信息,尤其是次要版本号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM