0

I have the following code inside a .sh script:

#!/bin/ksh
# Set environment variables
ANT_HOME=/home/tools/ANT1.8.2
ANT_OPTS="-Xmx512m"
cd `dirname $0`/..
BASEDIR=`pwd`

PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH
export PATH JAVA_HOME ANT_HOME ANT_OPTS

echo
java -version
echo "JAVA_HOME: $JAVA_HOME"
echo "CLASSPATH: $CLASSPATH"
echo "ANT_HOME: $ANT_HOME"
echo
env

JAVA_HOME has already been set before running the script. I am getting the following output:

java: java: cannot execute [Exec format error]
JAVA_HOME: /path/to/jdk1.6_64bit
CLASSPATH:
ANT_HOME: /home/tools/ANT1.8.2

_=*32592*/bin/env
ANT_HOME=/home/tools/ANT1.8.2
ANT_OPTS=-Xmx512m
...so on

The machine is 64-bit. I do not understand why am I getting the java error. The weird part here is this:

_=*32592*/bin/env

It looks like I am getting the error due to this 32592 but I'm not able to figure out what it is??

Can someone please help me or give me some suggestions?

EDIT: Sorry, I am running this script on Linux machine itself, not AIX machine. The reason I am pointing JAVA_HOME to an aix version is because further operations are done after connecting to an AIX machine through this script.

praveena
  • 41
  • 1
  • 1
  • 9
  • 1
    What is the output of `file /path/to/jdk1.6_64bit/bin/java`? – Elliott Frisch Dec 13 '15 at 04:25
  • `bash: /path/to/java1.6.sp8.64bit/bin/java: cannot execute binary file`. I have tried setting it to other updates of JDK like java1.6.sp16.64bit as well. But I'm getting the same error. – praveena Dec 13 '15 at 04:31
  • can you run /path/to/jdk1.6_64bit/bin/java -version from a shell directly? Please check whether it gives the same error. – Joey Yi Zhao Dec 13 '15 at 04:32
  • Hi Zhao, you mean from the command line right? I did that (my comment above). It doesn't matter which shell I'm using, I'm still getting that error. – praveena Dec 13 '15 at 04:36

0 Answers0