[GRADLE-2361] ")" character in JAVA_OPTS causes escaping problem in `gradle` startup script Created: 25/Jun/12 Updated: 10/Feb/17 Resolved: 10/Feb/17 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | ||
Reporter: | Gradle Forums | Assignee: | Unassigned |
Resolution: | Won't Fix | Votes: | 0 |
Description |
Hi all, When the JAVA_OPTS variable in my .bashrc file contains a round closing bracket ")" I get the following error when I try and run Gradle: /usr/local/java/gradle-1.0/bin/gradle: eval: line 161: syntax error near unexpected token `)' My JAVA_OPTS declaration in my .bashrc file is as follows: export JAVA_OPTS="-Djavax.net.ssl.trustStore=/home/egrant/Documents/Work/jssecacerts \ When this happens Gradle seems to sit and cogitate for a few seconds whenever I ask it to do something, even if I'm using the daemon. It does then work correctly and execute the task I have requested but the wait, and the presence of the error, is rather annoying. If I remove the ")" character everything reverts back to normal and Gradle becomes marvellous once again. Has anyone else encountered this? Any ideas as to a workaround (I'm unable to change my cert password to work around this otherwise that would be a workable temporary workaround). Cheers, Edd Version details below: Running ------------------------------------------------------------ Gradle build time: Tuesday, June 12, 2012 12:56:21 AM UTC |
Comments |
Comment by Gradle Forums [ 25/Jun/12 ] |
Have you tried to escape the `)` with a `\`? |
Comment by Gradle Forums [ 25/Jun/12 ] |
Sorry forgot to mention that, yes I have, it fixes the Gradle issue but it creates another issue in that my cert password seems to become invalid to things that use it such as Maven, which then spurts the following: Error transferring file: java.security.NoSuchAlgorithmException: This had led me to the conclusion that the \ character wasn't being treated as an escape character but rather as an additional literal \ character. I guess this makes sense since it's a legal character to have in a Java String and isn't a String terminator. I'm curious to know it would need escaping for Gradle to work? |
Comment by Gradle Forums [ 25/Jun/12 ] |
If not escaped, bash treats `)` in the `gradle` script as a bash meta character. Maybe it's a problem with that script. I'll open an issue for this. Meanwhile, you can try to set a `GRADLE_OPTS` which does escape the `)`. If that still causes problems due to the unescaped character in `JAVA_OPTS`, you could edit the `gradle` script to no longer consider `JAVA_OPTS`. |
Comment by Benjamin Muschko [ 15/Nov/16 ] |
As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub. We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to. Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:
We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle! |
Comment by Benjamin Muschko [ 10/Feb/17 ] |
Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved. |