cannot execute message


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers cannot execute message
# 1  
Old 01-29-2008
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
# 2  
Old 01-29-2008
trying to understand which command is in error?

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.
# 3  
Old 01-29-2008
Quote:
Originally Posted by joeyg
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'
# 4  
Old 01-29-2008
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)
# 5  
Old 01-30-2008
Results of the ls and file command

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
# 6  
Old 01-30-2008
Code:
-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:
Code:
ls -ld /export/home/data

Or
Code:
ls -ld /export/home/data/SoftwareSource/TcEng2005SR1

Or
Code:
ls -ld /export/home/data/SoftwareSource/TcEng2005SR1/install

Code:
/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? Smilie

Next question, what happens if you run (as the same user that would run the installer):
Code:
/export/home/data/SoftwareSource/TcEng2005SR1/install/jre/bin/java -version


Last edited by Smiling Dragon; 01-30-2008 at 06:12 PM.. Reason: Fixed a 'code' tag that was making it hard to read
# 7  
Old 01-30-2008
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!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. SuSE

Du -sh in / message

I have cloned a zLinux server and whenever I issue the command 'du -sh' on the / it always gives the below message: du: cannot access `./proc/3721/task/3721/fd/4': No such file or directory du: cannot access `./proc/3721/task/3721/fdinfo/4': No such file or directory du: cannot access... (5 Replies)
Discussion started by: schizoprenics
5 Replies

2. UNIX and Linux Applications

Ssmtp -t < /path/to/the/message.txt (How to format message.txt for html email)

ssmtp has been running well under Kubuntu 12.04.1 for plain text messages. I would like to send html messages with ssmtp -t < /path/to/the/message.txt, but I cannot seem to get the message.txt file properly formatted. I have tried various charsets, Content-Transfer-Encoding, rearranging the... (0 Replies)
Discussion started by: Ronald B
0 Replies

3. Programming

[XQuery] How to Convert from JSON Message to XML Message with XQuery

Hi guys, I'm in a job of converting a restful webservice to soap. Tool for convertation uses XQuery. Now i need to convert a message like this: { "firstName": "John", "midName": null, "lastName": "Smith", "married": false, "address": { "streetAddress": "21 2nd... (5 Replies)
Discussion started by: tien86
5 Replies

4. Shell Programming and Scripting

Nightly job error message when trying to execute script

Hello All, I am getting the following error message when trying to execute the following script. AWK=/usr/bin/awk TR=/usr/bin/tr SED=/usr/bin/sed CAT=/usr/bin/cat MAILFILE=/home//nightly_jobs.tmp mailto=xxx@gmail.com Nigh_Status = `db2 "select TYPE from ETL.LOCK where STATUS <> 0 and... (12 Replies)
Discussion started by: NARESH1302
12 Replies

5. Shell Programming and Scripting

How to capture actual error message when a command fails to execute

I want to capture actual error message in case the commands I use in my shell script fails. For eg: ls -l abc.txt 2>>errorlog.txt In this case I understand the error message is written to the errorlog.txt and I assume its bacause the return code from the command ls -l abc might return 2 if... (3 Replies)
Discussion started by: prathima
3 Replies

6. Solaris

What is this message!?

While logged on to a box, I got the message: Broadcast Message from oracle (pts/4) on hostname.xx-xxxx.xxx Thu Mar 19 19:00:38... root: Will system be available for use tonight? n -----> this was my response ksh: n: not found Where does this originate from? Did somebody send it to my... (6 Replies)
Discussion started by: FeNiCrC_Neil
6 Replies

7. Solaris

Installing gcc - recieve error message gcc : cannot execute

AIM- Install Oracle 11g on Solaris using VMWare Steps 1.Logged on as root 2.Created subfolders /usr/local/bin & /usr/local/bin/gcc 3.Downloaded gcc & libiconv & unzipped them on my harddrive & burnt them on CD 4.Copied files from CD to /usr/local/bin/gcc 5.Terminal (root) pkgadd -d... (8 Replies)
Discussion started by: Ackers
8 Replies

8. Programming

How to limit max no of message in a posix message queue

Hii can anyone pls tell how to limit the max no of message in a posix message queue. I have made changes in proc/sys/fs/mqueue/msg_max But still whenever i try to read the value of max. message in the queue using attr.mq_curmsgs (where struct mq_attr attr) its giving the default value as 10.... (0 Replies)
Discussion started by: mohit3884
0 Replies

9. Shell Programming and Scripting

script execute or no execute

o hola.. Tengo un script que se ejecuta bajo una tarea del CronJOb del unix, tengo la version 11 de unix, mi script tiene un ciclo que lee unos archivos .txt luego cada uno de esos archivos debe pasar por un procedimiento almacenado el cual lo tengo almacenado en mi base de datos oracle 10g,... (4 Replies)
Discussion started by: Kespinoza97
4 Replies

10. Shell Programming and Scripting

Need to execute 2 scripts, wait, execute 2 more wait, till end of file

:cool: I need to execute a shell script to do the following: cat a file run two back ground processes using the first two values from the file wait till those background processes finish run two more background processes using the next two values from the file wait till those background... (1 Reply)
Discussion started by: halo98
1 Replies
Login or Register to Ask a Question

Featured Tech Videos