title: Gradle Hello World Error
body: <p>I tried my first program in Gradle but I got an error. I wrote a hello world script but I am unable to run it.</p>
  
  <p>My gradle details are:</p>
  
  <pre><code>------------------------------------------------------------
  Gradle 2.0
  ------------------------------------------------------------
  
  Build time:   2014-07-01 07:45:34 UTC
  Build number: none
  Revision:     b6ead6fa452dfdadec484059191eb641d817226c
  
  Groovy:       2.3.3
  Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
  JVM:          1.8.0_11 (Oracle Corporation 25.11-b03)
  OS:           Windows 7 6.1 x86
  </code></pre>
  
  <p>My build.gradle is:</p>
  
  <pre><code>task hello &lt;&lt; {
      println 'Hello world!'
  }
  </code></pre>
  
  <p>When I run <code>gradle -q --info hello</code>, I get the following error:</p>
  
  <pre><code>Starting Build
  Settings evaluated using empty settings script.
  Projects loaded. Root project using build file 'D:\Gradle\build.gradle'.
  Included projects: [root project 'Gradle']
  Evaluating root project 'Gradle' using build file 'D:\Gradle\build.gradle'.
  
  FAILURE: Build failed with an exception.
  
  * Where:
  Build file 'D:\Gradle\build.gradle' line: 1
  
  * What went wrong:
  A problem occurred evaluating root project 'Gradle'.
  &gt; Could not find property 'hello' on root project 'Gradle'.
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --debug option to
  get more log output.
  
  BUILD FAILED
  
  Total time: 7.048 secs
  </code></pre>
  
  <p>The stacktrace is as follows:</p>
  
  <pre><code>Exception is:
  org.gradle.api.GradleScriptException: A problem occurred evaluating root project
   'Gradle'.
          at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptR
  unnerImpl.run(DefaultScriptRunnerFactory.java:54)
          at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.
  apply(DefaultScriptPluginFactory.java:187)
          at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildSc
  riptProcessor.java:39)
          at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildSc
  riptProcessor.java:26)
          at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.eva
  luate(ConfigureActionsProjectEvaluator.java:34)
          at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(L
  ifecycleProjectEvaluator.java:55)
          at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj
  ect.java:470)
          at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj
  ect.java:79)
          at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuil
  dConfigurer.java:31)
          at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default
  GradleLauncher.java:128)
          at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradle
  Launcher.java:105)
          at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLaun
  cher.java:85)
          at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildCon
  troller.run(InProcessBuildActionExecuter.java:81)
          at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav
  a:33)
          at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav
  a:24)
          at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce
  ssBuildActionExecuter.java:39)
          at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce
  ssBuildActionExecuter.java:29)
          at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
          at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.jav
  a:171)
          at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.
  execute(CommandLineActionFactory.java:237)
          at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.
  execute(CommandLineActionFactory.java:210)
          at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRunti
  meValidationAction.java:35)
          at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRunti
  meValidationAction.java:24)
          at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(
  CommandLineActionFactory.java:206)
          at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(
  CommandLineActionFactory.java:169)
          at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep
  ortingAction.java:33)
          at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep
  ortingAction.java:22)
          at org.gradle.launcher.Main.doAction(Main.java:33)
          at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
          at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBoots
  trap.java:54)
          at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.j
  ava:35)
          at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
  Caused by: groovy.lang.MissingPropertyException: Could not find property 'hello'
   on root project 'Gradle'.
          at org.gradle.api.internal.AbstractDynamicObject.propertyMissingExceptio
  n(AbstractDynamicObject.java:43)
          at org.gradle.api.internal.AbstractDynamicObject.getProperty(AbstractDyn
  amicObject.java:35)
          at org.gradle.api.internal.CompositeDynamicObject.getProperty(CompositeD
  ynamicObject.java:94)
          at org.gradle.groovy.scripts.BasicScript.propertyMissing(BasicScript.jav
  a:66)
          at build_4hki6gadurnm5c9ejslud0e844.run(D:\Gradle\build.gradle:1)
          at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptR
  unnerImpl.run(DefaultScriptRunnerFactory.java:52)
          ... 31 more
  
  
  BUILD FAILED
  
  Total time: 26.219 secs
  amicObject.java:35)
          at org.gradle.api.internal.CompositeDynamicObject.getProperty(CompositeD
  ynamicObject.java:94)
          at org.gradle.groovy.scripts.BasicScript.propertyMissing(BasicScript.jav
  a:66)
          at build_4hki6gadurnm5c9ejslud0e844.run(D:\Gradle\build.gradle:1)
          at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptR
  unnerImpl.run(DefaultScriptRunnerFactory.java:52)
          ... 31 more
  </code></pre>