# Test failed while building gradle from sources because of JAVA\_TOOL\_OPTIONS defined

**URL:** <https://discuss.gradle.org/t/test-failed-while-building-gradle-from-sources-because-of-java-tool-options-defined/4441>\
**Category:** Old Forum Archive\
**Created:** [April 29, 2012, 3:50pm UTC](https://discuss.gradle.org/t/test-failed-while-building-gradle-from-sources-because-of-java-tool-options-defined/4441 "2012-04-29T15:50:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcpa00](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/marcpa00/32/285_2.png) [@marcpa00](https://discuss.gradle.org/u/marcpa00)\
**Post date:** [April 29, 2012, 3:50pm UTC](https://discuss.gradle.org/t/test-failed-while-building-gradle-from-sources-because-of-java-tool-options-defined/4441/1 "2012-04-29T15:50:00Z")

</div>

When I build gradle from sources, test DefaultExecHandleSpec fails because I have defined the environment variable JAVA\_TOOL\_OPTIONS.

The jvm always outputs “Picked up JAVA\_TOOL\_OPTIONS: -Dfile.encoding=UTF8” on stderr when that environment variable is defined, leading to this failed test.

Since this is a known behavior of the java program, I guess the test (or gradle ? or spock ?) should be prepared to this : maybe it should either discard any line from standard error having this text (but what about localized java command ?) or it should arrange to remove JAVA\_TOOL\_OPTIONS prior to calling the artifact under test.

Should I raise an issue ?

Marc

---

<div class="post-metadata">

**Author:** ![Szczepan\_Faber](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/szczepan_faber/32/213_2.png) [@Szczepan\_Faber](https://discuss.gradle.org/u/Szczepan_Faber)\
**Post date:** [April 30, 2012, 10:39am UTC](https://discuss.gradle.org/t/test-failed-while-building-gradle-from-sources-because-of-java-tool-options-defined/4441/2 "2012-04-30T10:39:00Z")

</div>

Yes, please. The test should depend on JAVA\_TOOL\_OPTIONS env variable.

---

<div class="post-metadata">

**Author:** ![Szczepan\_Faber](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/szczepan_faber/32/213_2.png) [@Szczepan\_Faber](https://discuss.gradle.org/u/Szczepan_Faber)\
**Post date:** [April 30, 2012, 6:46pm UTC](https://discuss.gradle.org/t/test-failed-while-building-gradle-from-sources-because-of-java-tool-options-defined/4441/3 "2012-04-30T18:46:00Z")

</div>

A typo in my previous post: this test should _not_ depend on any env variable.
