[GRADLE-2799] Gradle does not start on AIX Created: 20/Jun/13  Updated: 21/Aug/15  Resolved: 21/Aug/15

Status: Resolved
Project: Gradle
Affects Version/s: 1.5
Fix Version/s: 2.8-rc-1

Type: Bug
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Fixed Votes: 6


I have downloaded and unzipped gradle-bin-1.5 and when have added the gradle_home/bin also to the PATH environment variable. But when I execute gradle, I get this weird issue as follows:

  1. gradle -v
    /gradle-1.5/bin/gradle: line 65: pwd: write error: A file descriptor does not refer to an open file.
    /gradle-1.5/bin/gradle: line 23: echo: write error: A file descriptor does not refer to an open file.

JAVA_HOME is set as follows: export JAVA_HOME=/usr/java6/bin
PATH looks like this:

  1. echo $PATH

Please advise.

Comment by Daniel Ritter [ 04/Feb/14 ]


it seems to be an issue with older versions of bash under AIX.
I've tested gradle and gradlew from version 1.8 and 1.10 and each of them fails under AIX.
It looks like as if the bash does not like it if STDOUT is closed before it was opened ( >&- ).
The script works perfectly under AIX as soon as I remove the string ">&-" at lines 64 and 66.

Maybe someone could clarify why it is really necessary to close STDOUT at those lines.

Best regards,

Daniel Ritter

Comment by Nathan Williams [ 30/Sep/14 ]

This bit us this morning when we updated our AIX bash due to shellshock. The ">&-" had been working fine, but suddenly started causing errors like those described above. Removing the redirection solved the problem, but it's something we'll have to remember to do for every gradle deploy.

The redirection was originally added for GRADLE-2501. Reading through that issue, I don't see a reason why the same thing couldn't be accomplished with a more conventional (and hopefully compatible) "> /dev/null".

Comment by Doug Bender [ 30/Sep/14 ]

Same problem here after patching bash on AIX for shellshock.

Generated at Wed Jun 30 12:31:51 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.