# Program arguments with spaces

**URL:** <https://discuss.gradle.org/t/program-arguments-with-spaces/25136>\
**Category:** Buildship\
**Tags:** buildship, eclipse\
**Created:** [December 14, 2017, 10:16pm UTC](https://discuss.gradle.org/t/program-arguments-with-spaces/25136 "2017-12-14T22:16:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![err108](https://avatars.discourse-cdn.com/v4/letter/e/f14d63/32.png) [@err108](https://discuss.gradle.org/u/err108)\
**Post date:** [December 14, 2017, 10:16pm UTC](https://discuss.gradle.org/t/program-arguments-with-spaces/25136/1 "2017-12-14T22:16:56Z")

</div>

I’m trying to pass in parameters to tasks using program arguments through the Eclipse Buildship plugin and can’t seem to get it to accept program arguments with spaces. I’ve tried enclosing with quotes which works fine via the command line, but doesn’t seem to work with Buildship. It sees the space and interprets what comes next as a task. Is there another way to enclose program argument values to include spaces?

Buildship: 2.2.0  
Gradle: 4.4  
Java: 1.8.0\_121

An example of trying to enclose with quotes through the Buildship plugin…

![program_arguments](https://global.discourse-cdn.com/gradle/original/2X/a/a87194df73cc2c6c5f8abb825a4640858355fa57.JPG)

…  
Gradle Distribution: Specific Gradle version 4.4  
Gradle Version: 4.4  
Java Home: C:\Program Files\Java\jdk1.8.0\_121  
JVM Arguments: None  
Program Arguments: -PwebDriver=chrome -PappEnv=DEVELOPMENT **-PappVersion="Version no : 005.014"**  
Build Scans Enabled: false  
Offline Mode Enabled: false  
Gradle Tasks: test

webDriver: chrome  
appEnv: DEVELOPMENT  
appVersion: "Version

FAILURE: Build failed with an exception.

- What went wrong:  
**Task ‘no’ not found in root project ‘MyProject’.**  
…

And running from the command line…

C:\MyProject\>gradlew build -PwebDriver=chrome -PappEnv=DEVELOPMENT -PappVersion=“Version no : 005.014”  
webDriver: chrome  
appEnv: DEVELOPMENT  
appVersion: Version no : 005.014  
:compileJava UP-TO-DATE  
…

---

<div class="post-metadata">

**Author:** ![donat](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/donat/32/7798_2.png) [@donat](https://discuss.gradle.org/u/donat)\
**Post date:** [December 15, 2017, 4:54pm UTC](https://discuss.gradle.org/t/program-arguments-with-spaces/25136/2 "2017-12-15T16:54:23Z")

</div>

Your report is correct, Buildship at this moment can’t handle spaces in the arguments. I’ve opened a [bug report](https://github.com/eclipse/buildship/issues/624) for that.

It is only the UI that doesn’t let you do that. So, for the time being, you can work around that as follows:

- on the `common` tab save the run config to a shared file.

 ![54](https://global.discourse-cdn.com/gradle/original/2X/8/88dced1c09b18d8e149ff9957dd35f7379052e77.png)

- then edit the argument list within the file. It will look something like this

```gradle
<listAttribute key="arguments">
<listEntry value="-Pfoo=bar baz"/>
</listAttribute>

```

---

<div class="post-metadata">

**Author:** ![hanct](https://avatars.discourse-cdn.com/v4/letter/h/43a26b/32.png) [@hanct](https://discuss.gradle.org/u/hanct)\
**Post date:** [May 5, 2019, 2:32pm UTC](https://discuss.gradle.org/t/program-arguments-with-spaces/25136/3 "2019-05-05T14:32:24Z")

</div>

Is this issue solved?  
Currently in command line using gradle 5.3.1, i am able to run this successfully  
gradlew.bat bootRun --args="–spring.main.banner-mode=log --data.server=remoteHost:999"

But when I try running in spring tool suite 4 , I configure the same in the Run Configuration, I got error. So up to now, buildship still can’t handle spaces in the arguments?

---

<div class="post-metadata">

**Author:** ![donat](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/donat/32/7798_2.png) [@donat](https://discuss.gradle.org/u/donat)\
**Post date:** [May 27, 2019, 7:29am UTC](https://discuss.gradle.org/t/program-arguments-with-spaces/25136/4 "2019-05-27T07:29:39Z")

</div>

This has been [fixed](https://github.com/eclipse/buildship/issues/624) in the latest Buildship snapshot. Can you please give it a try and provide us feedback?
