# Execution failed for task ':test' building java HelloWorld

**URL:** <https://discuss.gradle.org/t/execution-failed-for-task-test-building-java-helloworld/1157>\
**Category:** Old Forum Archive\
**Created:** [January 24, 2014, 11:41am UTC](https://discuss.gradle.org/t/execution-failed-for-task-test-building-java-helloworld/1157 "2014-01-24T11:41:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodrigo\_munoz](https://avatars.discourse-cdn.com/v4/letter/r/6f9a4e/32.png) [@rodrigo\_munoz](https://discuss.gradle.org/u/rodrigo_munoz)\
**Post date:** [January 24, 2014, 11:41am UTC](https://discuss.gradle.org/t/execution-failed-for-task-test-building-java-helloworld/1157/1 "2014-01-24T11:41:00Z")

</div>

hi, i want work with gradle… but i don’t know why i have this problem. I have the next structure meinproject/src/main/java/ here i have my java file like:

```gradle
public class HelloWorld{
 public static void main(String[] args){
  System.out.println("Hello World");
 }
}

```

then in meinproject folder i have my build.gradle file with apply plugin: “java” … it’s the most simple example… but i have the next result

```gradle
[sudo] password for bazaar-test:
 :compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar
:assemble
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test
  FAILURE: Build failed with an exception.
  * What went wrong:
Execution failed for task ':test'.
Cause: Could not generate test report to '/home/bazaar-test/meinproject/build/reports/tests'.
Cause: java.lang.NullPointerException (no error message)
  * Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  BUILD FAILED
  Total time: 4.854 secs

```

I tried with sudo… with JAVA\_HOME with JRE… i tried with :

```gradle
gradle build -x test

```

this command work, but I want to test…

features: /\*\*\*\*\*\* ubuntu\*\*\*\*\*\*\*\*\*/ Distributor ID: Ubuntu Description: Ubuntu 12.04.3 LTS Release: 12.04 /\*\*\*\*\*\*\*\*\*gradle \*\*\*\*\*\*\*\*\*\*\*\*\* ------------------------------------------------------------ Gradle 1.0-milestone-3 ------------------------------------------------------------

Gradle build time: Thursday, September 8, 2011 4:06:52 PM UTC Groovy: 1.8.6 Ant: Apache Ant™ version 1.8.2 compiled on December 3 2011 Ivy: non official version JVM: 1.6.0\_27 (Sun Microsystems Inc. 20.0-b12) OS: Linux 3.8.0-29-generic i386 /\*\*\*\*\*\*\*\*\*\*\* java \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/ I have too jre1.7.0\_51… jdk1.7.0\_51 java version “1.6.0\_27” OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b27-1.12.6-1ubuntu0.12.04.4) OpenJDK Client VM (build 20.0-b12, mixed mode, sharing) \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

thanks for your help regads Rodrigo

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [January 24, 2014, 4:30pm UTC](https://discuss.gradle.org/t/execution-failed-for-task-test-building-java-helloworld/1157/2 "2014-01-24T16:30:00Z")

</div>

Please switch to a newer Gradle version. We won’t be able to help you out with 1.0-m3.
