How do you make gradle run?


(marius.hubatschek) #1

Hello, I’m desperate: I don’t get how to make gradle run. Where do I have to put the gradle-1.4 folder to be able to just go into a project by command line and type “gradle”? I read something about system32, so I but the .bat file there…but I’m getting a “Main class not found org.gradle.launcher.GradleMain”.

Please please please tell me how that works. I just can’t figure it out! I might need a detailed description Thanks in advance…


(Peter Niederwieser) #2

It doesn’t matter (to Gradle) where you put the unzipped directory. What’s important is that you put ‘unzipped_directory\bin’ on the operating system path. For more information, see Installing Gradle in the Gradle user guide.

PS: Many builds use the Gradle Wrapper, which makes it unnecessary to install Gradle manually. On *nix, you can also install Gradle via a package manager.


#3

Try these instructions: http://www.gradle.org/docs/current/userguide/installation.html


(marius.hubatschek) #4

Does this mean that I put the gradle folder into my new project, then use the console to go there and run gradle? And I make a build.gradle and settings.gradle file? If yes, how would I integrate that in IntelliJ (e.g. to set a sourcepath like this:

task(run, dependsOn: ‘classes’, type: JavaExec){

main= ‘com.mojang.mojam.BattleToads’

classpath = sourceSets.main.runtimeClasspath }

sourceSets{

main{

resources{

srcDir= ‘src/main/res’

}

} } )? I don’t have experience with gradle yet, that’s why I’m asking. Thank you for you reply, by the way.


(Peter Niederwieser) #5

Please use HTML code tags for all source code.

The Gradle installation should go into its own folder, separated from your projects. After you have put the ‘bin’ subdirectory on your OS path, you’ll be able to invoke Gradle from any folder (on the console). The best way to get started is to read the Getting Started chapters in the Gradle User Guide and experiment with some of the many sample builds in the full Gradle distribution (see the ‘samples’ subdirectory).