I can`t find how to 'compile' gradle

When I trying to write and use this line: compile group: ‘org.springframework’, name: ‘spring-aop’, version: ‘4.0.5.RELEASE’ I have these error:

FAILURE: Build failed with an exception.

  • What went wrong:
    Task ‘compile’ not found in root project ‘JavaStudy’.

  • Try:
    Run gradle tasks to get a list of available tasks. 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

BUILD FAILED in 4s

I`m new on Gradle and spring framework, please help me with resolving these error. Thanks!

It is difficult to tell what is wrong without seeing more of your build script (build.gradle).
If you are new to Spring and Gradle, then I suggest you start off by making a project using the Spring Initializr. It will create you a Gradle project with a baseline spring configuration.