The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
awk and execute app tyger52 Shell Programming and Scripting 0 12-06-2007 05:43 PM
execute bkan77 Shell Programming and Scripting 3 07-20-2007 10:42 AM
script execute or no execute Kespinoza97 Shell Programming and Scripting 4 06-23-2007 06:27 AM
Need to execute 2 scripts, wait, execute 2 more wait, till end of file halo98 Shell Programming and Scripting 1 08-01-2006 01:42 PM
awk and execute command ??? sabercats Shell Programming and Scripting 13 03-28-2006 03:12 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-29-2008
Registered User
 

Join Date: Jan 2008
Posts: 5
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
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-29-2008
joeyg's Avatar
premier etoile de match
 

Join Date: Dec 2007
Location: Home of world champion Boston Celtics
Posts: 533
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.
Reply With Quote
  #3 (permalink)  
Old 01-29-2008
Registered User
 

Join Date: Jan 2008
Posts: 5
Quote:
Originally Posted by joeyg View Post
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'
Reply With Quote
  #4 (permalink)  
Old 01-29-2008
Smiling Dragon's Avatar
Disorganised User
 
Join Date: Nov 2007
Location: New Zealand
Posts: 674
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)
Reply With Quote
  #5 (permalink)  
Old 01-30-2008
Registered User
 

Join Date: Jan 2008
Posts: 5
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
Reply With Quote
  #6 (permalink)  
Old 01-30-2008
Smiling Dragon's Avatar
Disorganised User
 
Join Date: Nov 2007
Location: New Zealand
Posts: 674
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?

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 02:12 PM. Reason: Fixed a 'code' tag that was making it hard to read
Reply With Quote
  #7 (permalink)  
Old 01-30-2008
Registered User
 

Join Date: Jan 2008
Posts: 5
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!
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:17 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0