Fail to set up Gradle on AIX

Fail to set up Gradle on AIX

os :AIX 6.1 gradle:1.6 JDK: IBM java6_64

.profile

JAVA_HOME=/usr/java6_64 GRADLE_HOME=/app/builder/javalib/gradle-1.6

PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:$JAVA_HOME/bin:$GRADLE_HOME/bin:.

export JAVA_HOME export GRADLE_HOME export PATH

if [ -s “$MAIL” ]

This is at Shell startup. In normal then echo “$MAILMSG”

operation, the Shell checks fi

end .profile

the path is correct

But when I run Gradle, it returns: $ sh gradle gradle[158]: syntax error at line 158 : ‘(’ unexpected

$ gradle bash: No such file or directory

Apparently, you didn’t set ‘PATH’ correctly; otherwise, I’d expect ‘$ gradle’ to find the startup script. ‘GRADLEHOME’ should be ‘GRADLE_HOME’.

PS: Please use HTML code tags for code snippets and the like.

.profile

JAVA_HOME=/usr/java6_64 GRADLE_HOME=/app/builder/javalib/gradle-1.6

PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:$JAVA_HOME/bin:$GRADLE_HOME/bin:.

export JAVA_HOME export GRADLE_HOME export PATH

if [ -s “$MAIL” ]

This is at Shell startup. In normal then echo “$MAILMSG”

operation, the Shell checks fi

Can you tell if “bash: No such file or directory” has the same root cause as “gradle[158]: syntax error at line 158 : (’ unexpected”, or if it does not find the ‘gradle’ script in the first place? Does ‘cat gradle’ work? Are execute permissions set correctly?

thanks for your help! AIX 6.1 ,bash was not install,by default~

I still get this error when I try to run gradle on AIX

gradle -version /home/pradeep9/source/src/powersc/ts/gradle/gradle-1.5/bin/gradle: line 65: pwd: write error: A file descriptor does not refer to an open file. /home/pradeep9/source/src/powersc/ts/gradle/gradle-1.5/bin/gradle: line 23: echo: write error: A file descriptor does not refer to an open file.

Hello,

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

PS: I’ve also replied to issue [GRADLE-2799].

Hi Daniel,

We inherited this script from the Groovy project. We are asking there while STDOUT is being closed.

Any news here ? I’m still facing the problem with Gradle 2.0 under AIX 7.1 / bash 4.2.1 …