The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 09:43 PM
execute bkan77 Shell Programming and Scripting 3 07-20-2007 01:42 PM
script execute or no execute Kespinoza97 Shell Programming and Scripting 4 06-23-2007 09: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 04:42 PM
awk and execute command ??? sabercats Shell Programming and Scripting 13 03-28-2006 06:12 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-29-2008
mncduffy mncduffy is offline
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
  #2 (permalink)  
Old 01-29-2008
joeyg's Avatar
joeyg joeyg is offline Forum Staff  
modérateur
  
 

Join Date: Dec 2007
Location: Home of 17-time world champion Boston Celtics
Posts: 1,311
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 (permalink)  
Old 01-29-2008
mncduffy mncduffy is offline
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'
  #4 (permalink)  
Old 01-29-2008
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 922
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 (permalink)  
Old 01-30-2008
mncduffy mncduffy is offline
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
  #6 (permalink)  
Old 01-30-2008
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 922
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 06:12 PM.. Reason: Fixed a 'code' tag that was making it hard to read
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:16 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0