Can't add dependencies to the project

Hello everyone) I’am just newbie to Gradle, and I’ve faced a problem when adding dependencies to my java project. I need to add WEKA and Guava libraries to my project. Both are available in the Maven Central Repository. Here is my gradle script code (the content of build.gradle)

apply plugin: 'java'
apply plugin: 'eclipse'
    repositories {
  dependencies {
    runtime group: '', name: 'guava', version: '17.0'
    runtime group: '', name: 'weka-stable', version: '3.6.6'

When I’am running

gradle build

from CMD, I’am getting a lot of error messages, inferring that neither of those libraries were added to project. Surely the build fails. I don’t know what to do. Thanks in advance)

You need to make them ‘compile’ dependencies.

Thank You for reply)) But in the gradle book it says that


task depends on the


one. Can You please tell me what is special about


, that makes my build script fail.

The fact that ‘runtime’ extends from ‘compile’ means that every compile dependency is also a runtime dependency. The inverse isn’t true, hence if you only make these ‘runtime’ dependencies yet reference them from your Java code, compilation will fail.

Thank you very much))