[Dev] Mac shell problem

Olivier Dony olivier.dony at denali.be
Thu Aug 23 02:44:30 PDT 2007


On Aug 11, 2007, at 11:45 PM, Frank Cohen wrote:

> Any fellow Mac user's out there?

Of course!
I'm not sure if you still need help with this, but anyway...


> I'm running Mac OS X 10.4.10. I install TestMaker 5 rc1 and see  
> that the TestMaker.sh is correctly marked as an executable file.  
> From the Finder, when I double-click TestMaker.sh, I choose  
> Terminal to open the document, I see a Terminal window open and  
> then the following:
>
> frank-cohens-computer:~ frankcohen$ /Applications/ 
> PushToTest_TestMaker/TestMaker.sh; exit
> Starting PushToTest TestMaker...
> Exception in thread "main" java.lang.NoClassDefFoundError: com/ 
> pushtotest/testmaker/Main
>
> And when I open a Terminal window and do ./TestMaker.sh then  
> TestMaker runs correctly.

Finder starts the shell script in you $HOME, using an absolute path.
I believe the classpath problem comes from the numerous references to  
the current directory (./) in the construction of the TestMaker command.
It works when you start TestMaker manually as './TestMaker.sh'  
because you are in the TestMaker directory at that point.

There are different ways to fix this, either using only absolute  
paths in the classpath, or for example adding the following at the  
beginning of TestMaker.sh to figure out the actual TESTMAKER_HOME and  
start it from there:

   TESTMAKER_HOME=`dirname $0`
   cd $TESTMAKER_HOME

Hope this helps,


--
Olivier Dony

Denali s.a., "Bridging the gap between Business and IT"
Rue de Clairvaux 8, B-1348 Louvain-la-Neuve, Belgium
Office: +32 10 43 99 51  Fax: +32 10 43 99 52
www.denali.be

Legal Notice: This message may contain confidential and/or privileged  
information. If you are not the addressee or authorized to receive  
this for the addressee, you must not use, copy, disclose or take any  
action based on this message or any information herein. If you have  
received this message by mistake, please advise the sender  
immediately by return e-mail and delete this message from your  
system. Thank you for your cooperation.




More information about the Dev mailing list