# Gradle application plugin defaultJvmArgs are not escaped correctly

**URL:** <https://discuss.gradle.org/t/gradle-application-plugin-defaultjvmargs-are-not-escaped-correctly/1246>\
**Category:** Old Forum Archive\
**Created:** [September 15, 2014, 11:06am UTC](https://discuss.gradle.org/t/gradle-application-plugin-defaultjvmargs-are-not-escaped-correctly/1246 "2014-09-15T11:06:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nilsmagnus](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/nilsmagnus/32/349_2.png) [@nilsmagnus](https://discuss.gradle.org/u/nilsmagnus)\
**Post date:** [September 15, 2014, 11:06am UTC](https://discuss.gradle.org/t/gradle-application-plugin-defaultjvmargs-are-not-escaped-correctly/1246/1 "2014-09-15T11:06:00Z")

</div>

The applicationDefaultJvmArgs values are not escaped properly. I wanted to use a system-environment called PORT, but when i add the following to my build-script,

```gradle
applicationDefaultJvmArgs = ['-Ddw.server.applicationConnectors[0].port=$PORT']

```

it is compiled into a shell script with this value:

```gradle
DEFAULT_JVM_OPTS='"-Ddw.server.applicationConnectors[0].port=\$PORT"'

```

While what I wanted was without the escaping character like this:

```gradle
DEFAULT_JVM_OPTS='"-Ddw.server.applicationConnectors[0].port=$PORT"'

```

A workaround is to use the WEBAPP\_OPTS, but I would really like to keep the config as simple as possible.

I have also asked about this on stackoverflow with a comment from Peter Niederwieser here: [http://stackoverflow.com/questions/25814455/gradle-application-plugin-and-system-environment-variables](http://stackoverflow.com/questions/25814455/gradle-application-plugin-and-system-environment-variables)

---

<div class="post-metadata">

**Author:** ![nilsmagnus](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/nilsmagnus/32/349_2.png) [@nilsmagnus](https://discuss.gradle.org/u/nilsmagnus)\
**Post date:** [September 18, 2014, 10:32am UTC](https://discuss.gradle.org/t/gradle-application-plugin-defaultjvmargs-are-not-escaped-correctly/1246/2 "2014-09-18T10:32:00Z")

</div>

Probably a duplicate of [http://forums.gradle.org/gradle/topics/createstartscripts\_in\_application\_plugin\_escapes\_whether\_you\_want\_it\_to\_or\_not](http://forums.gradle.org/gradle/topics/createstartscripts_in_application_plugin_escapes_whether_you_want_it_to_or_not) ,

reported in GRADLE-3084
