# Run JUnit/TestFX tests against specific JRE

**URL:** <https://discuss.gradle.org/t/run-junit-testfx-tests-against-specific-jre/34672>\
**Category:** Help/Discuss\
**Created:** [January 24, 2020, 4:35pm UTC](https://discuss.gradle.org/t/run-junit-testfx-tests-against-specific-jre/34672 "2020-01-24T16:35:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![micujoshi](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@micujoshi](https://discuss.gradle.org/u/micujoshi)\
**Post date:** [January 24, 2020, 4:35pm UTC](https://discuss.gradle.org/t/run-junit-testfx-tests-against-specific-jre/34672/1 "2020-01-24T16:35:02Z")

</div>

Hi,

is it possible to specify JRE for JUnit and integration tests (TestFX) execution with Gradle?

For instance, we are using custom JRE to run our product so we would like to run integration tests against that environment.

---

<div class="post-metadata">

**Author:** ![Lance](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/lance/32/787_2.png) [@Lance](https://discuss.gradle.org/u/Lance)\
**Post date:** [January 24, 2020, 6:00pm UTC](https://discuss.gradle.org/t/run-junit-testfx-tests-against-specific-jre/34672/2 "2020-01-24T18:00:24Z")

</div>

Assuming that the `TestFx` task extends the `Test` task you can set [executable](https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/testing/Test.html#setExecutable-java.lang.String-) property

Eg:

```gradle
tasks.withType(Test) {
   it.executable = "path/to/my/jdk/bin/java.exe"
} 

```
