3

I've learned Java language features in the past 3 months and compiled many projects using IntelliJ. The experience was great! But when I trying to learn Java Spring, I couldn't even get it running.

To run Spring, they introduce a new thing called Gradle. Why do we need it? I just couldn't figure out what Gradle is AFTER READING document on Gradle official site.

My previous java projects, class, packages was running perfectly. Why they invented Gradle? What is this thing?

Please be gentle. Thank you!

Nicolas S.Xu
  • 13,794
  • 31
  • 84
  • 129
  • This might help you: http://stackoverflow.com/tags/gradle/info – RaminS Apr 01 '16 at 18:47
  • Gradle is used to compile your Java code to executable classes. You have to know that Intellij (same as Eclipse) have maven, ant or gradle integrated. And that is why it works out of the box. – Jernej K Apr 01 '16 at 18:50
  • Since it seems you are familiar with frontend technologies, think of it as npm. – dambros Apr 01 '16 at 18:52
  • Gradle is a build tool, that's why this question is a duplicate of "What is a build tool?". – Jesper Apr 01 '16 at 19:12
  • @Jesper But I can just use java compiler to compile the code, why do I need to build it? I know NPM it is used to manage javascript package. – Nicolas S.Xu Apr 01 '16 at 19:25
  • April 1st, right? Please, please let it be April fool. – JBaruch Apr 01 '16 at 20:15
  • 1
    If you're happy with doing everything from your IDE, then don't look at gradle as a build tool. See it as a dependency management tool, that you can use to automatically download all the libraries needed by the project, and setup an IntelliJ project automatically, without having to manually download jar files and setup a project manually. Of course it's much much more than that. But the rest is answered by the duplicate question. Also relevant: http://stackoverflow.com/questions/10764576/why-do-we-need-maven-or-ant-if-we-already-have-eclipse – JB Nizet Apr 01 '16 at 20:18
  • 1
    @NicolasS.Xu When you start working on a bigger project with hundreds or thousands of classes, it's far too cumbersome to use `javac` to compile everything. Also, you don't want to be dependent on an IDE to build your code. You'll need a build tool which will automatically build everything in the right order and which can automatically run unit tests. – Jesper Apr 02 '16 at 07:42
  • Thanks @Jesper. It largely answered my question. I think figuring out what thing is is the most difficult task if you haven't see it before. – Nicolas S.Xu Apr 05 '16 at 18:01
  • And how exactly does it help you to become dependant on Gradle? Add to that the requirement of learning an additional laungage. Also the automatic downloading of dependancies can lead to project breaking. The whole Gradle concept sets you up to give you a lack of knowledge about the whole project. And the blind unit automated testing gives you nothing. You can't compensate lack of knowledge about your own project. And you can't "auto" download anything, you have to to know what you are downloading. Also you don't need to test whatever it is you want to add -with your whole 1000 classes. – Lealo Jan 13 '18 at 20:15
  • Gradle is not synonymus with build tool. And "why" are different from "what". This is not a duplicate – Lealo Jan 13 '18 at 20:17

0 Answers0