Gradle build .class files


(Sheng Long) #1

Completely new here, have set up paths.
Trying to follow a spring tutorial at this address: https://spring.io/guides/gs/gradle/
It asks me to create two files, Greeter.java and HelloWorld.java in a path …\src\main\java\hello
So in the \hello directory I have 3 files Greeter.java, HelloWorld.java and build.gradle (which comprises of one line: "apply plugin: ‘java’ ").
When I enter ‘gradle build’ into cmd at this directory’s location, a directory build is created in the directory but this directory does not include reports or classes. I assume this means it is not compiling the .java files I have created. Is there something that I’m doing wrong?

I realize that there are likely hundreds of posts like this, I’ve read a few and they haven’t helped.


(Sterling Greene) #2

Your build.gradle should go in the root directory of your project. See the completed example here: https://github.com/spring-guides/gs-gradle/tree/master/complete