cannot execute message

I am trying to install a piece of software using the provided install script, but when I run it, I get the following message: ./tem.sh[15]: /export/home/data/SoftwareSource/TcEng2005SR1/install/jre/bin/java: cannot execute

I navigated to that directory and tried to execute java and it returns the same message:
$ ./java
ksh: ./java: cannot execute

The install script is as follows:
#!/bin/ksh

SCRIPTDIR=`dirname $0` # The dir containing this script.
SCRIPTDIR=`cd ${SCRIPTDIR}; pwd` # Convert it to an absolute path -

cd ${SCRIPTDIR}

JARS=`ls -m install/*.jar|tr -s ',' ':'|tr -d ' \n'`

${SCRIPTDIR}/install/jre/bin/java -cp ${JARS} com.teamcenter.install.tem.struct.Tem $1 $2 $3

Any help is much appreciated,
mncduffy

Is the problem with the ./tem.sh perhaps? Kind of hard to follow the cut/paste with potential line-wrap issues.

Would a simple $chmod +x tem.sh solve this by making the shell script executable?
Then you would $tem.sh to execute the script.

Another thought to see where you are erroring is to edit the script (vi editor or other) and insert output comments such as:
echo "SCRIPTDIR is now set"
throughout the file. This will allow you to track the program progress.

Sorry for the mess....

The install script 'tem.sh' is excutable and so is the file it is trying to run.

The tem.sh script is failing on the line that trys to execute JAVA:
${SCRIPTDIR}/install/jre/bin/java -cp ${JARS} com.teamcenter.install.tem.struct.Tem $1 $2 $3

In a terminal window, I navigated to the directory reference by the tem.sh script, (${SCRIPTDIR}/install/jre/bin), and tried to execute 'java', (which has executable permission), by entering './java' (without the quotes). and it returns 'ksh: ./java: cannot execute'

Run the following two commands (as the same user that will be running the install):
ls -l /export/home/data/SoftwareSource/TcEng2005SR1/install/jre/bin/java
file /export/home/data/SoftwareSource/TcEng2005SR1/install/jre/bin/java

This will provide some more info on the nature of that file - it's looking a bit like permissions or something wrong with the java binary (eg it could be a wrapper script)

I ran the following:
$ ls -l /export/home/data/SoftwareSource/TcEng2005SR1/install/jre/bin/java

Which returned:
-rwxr-xr-x 1 infodba 78880 Jul 11 2006 /export/home/data/SoftwareSource/TcEng2005SR1/install/jre/bin/java

Then ran the following:
$ file /export/home/data/SoftwareSource/TcEng2005SR1/install/jre/bin/java

Which returned:
/export/home/data/SoftwareSource/TcEng2005SR1/install/jre/bin/java: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped

-rwxr-xr-x   1 infodba     78880 Jul 11  2006 /export/home/data/SoftwareSource/TcEng2005SR1/install/jre/bin/java

This suggests you don't have any permissions issues, but either the group or owner info is missing (ie, there aren't enough fields in that ls output). Is infodba the file owner or the group the file belongs to?

Do you get both the owner and group displayed if you do:

ls -ld /export/home/data

Or

ls -ld /export/home/data/SoftwareSource/TcEng2005SR1

Or

ls -ld /export/home/data/SoftwareSource/TcEng2005SR1/install
/export/home/data/SoftwareSource/TcEng2005SR1/install/jre/bin/java:     ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped

This is a SPARC compiled binary, are you running it on a SPARC processor? :slight_smile:

Next question, what happens if you run (as the same user that would run the installer):

/export/home/data/SoftwareSource/TcEng2005SR1/install/jre/bin/java -version

infodba is the owner

When I run:
ls -ld /export/home/data

I get:
drwxrwxrwx 3 root 512 Jan 29 12:45 /export/home/data

When I run:
ls -ld /export/home/data/SoftwareSource/TcEng2005SR1

I Get:
drwxr-xr-x 12 infodba 512 Jan 29 12:45 /export/home/data/SoftwareSource/TcEng2005SR1

When I run:
ls -ld /export/home/data/SoftwareSource/TcEng2005SR1/install

I get:
drwxr-xr-x 7 infodba 1536 Jul 11 2006 /export/home/data/SoftwareSource/TcEng2005SR1/install

This is not a SPARC processor, it is an Intel X86 version of Solaris

When I run:
/export/home/data/SoftwareSource/TcEng2005SR1/install/jre/bin/java -version

I get:
ksh: /export/home/data/SoftwareSource/TcEng2005SR1/install/jre/bin/java: cannot execute

Is the problem the processor type?

Thanks again for all of the help on this one!

There's the problem then. You need the x86 version. SPARC binaries are radically different and won't run on an x86 chip.
In a pinch, you could probably delete the /export/home/data/SoftwareSource/TcEng2005SR1/install/jre tree and replace just that with a SPARC JRE but you'd be likely to hit more problems if any other files in the install are compiled binaries.

Thanks for the help!:b: