Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This file is needed to run this program. I am new to Mac OS X and its terminal.

I am installing Apache Tomcat, using steps provided through this URL http://www.editrocket.com/articles/tomcat_mac.html, but when I run

sh startup.sh

I get the following error:

Cannot find /Users/user/tomcat/bin/setclasspath.sh
 This file is needed to run this program. 

Whereas setclasspath.sh already exists at this location.

share|improve this question

migrated from stackoverflow.com Dec 15 '12 at 9:54

This question came from our site for professional and enthusiast programmers.

1  
What happens if you use ${HOME} in place of /Users/user? –  Johnsyweb Dec 15 '12 at 6:18
    
Your permissions are probably not set right. Paste the output of the following command: ls -al –  Diego Basch Dec 15 '12 at 6:40

3 Answers 3

Check your CATALINA_HOME by doing echo $CATALINA_HOME

This should point to your where tomcat is installed.

Add this line in your ~/.bash_profile and source it.

export CATALINA_HOME=/path/to/tomcat-x.x
share|improve this answer

I know this is an older post, but I've come across this issue, as I have multiple instances of Tomcat on my dev machine, and tend to have them in subdirectories of my user account, to keep them separate from what comes stock with OS X.

I've found it's better to have these sorts of settings self-contained, that is, in a setenv.sh file, for each instance.

So, for example, if John Doe is running Tomcat v7.0.49, from within some directory he's created:

/Users/johndoe/Server/app/tomcat-7.0.49/bin/setenv.sh

And in that file:

export CATALINA_BASE="/Users/johndoe/Server/app/tomcat-7.0.49"
export CATALINA_HOME="/Users/johndoe/Server/app/tomcat-7.0.49"

This will work, pretty much from anywhere. You're now telling this particular Tomcat instance where to look for itself. Keep in mind, if you have multiple instances of the same Tomcat version in the same directory, you'll need to give each a unique parent folder name.

Also worthy of mention, CATALINA_BASE is optional, and will default to CATALINA_HOME, if you leave it out. Listing both is simply my personal preference.

share|improve this answer

I Googled your error and found the following result from malisphoto:

If you received the error "Cannot find /Library/Tomcat/Home/bin/setclasspath.sh," you are probably trying to install Tomcat in your home directory Library (~/Library). Either install Tomcat in the root Library (/Library) or point CATALINA_HOME to your home directory Tomcat installation directory, probably something like CATALINA_HOME=/Users/username/Library/Tomcat/Home. A basic installation doesn't require setting CATALINA_HOME or JAVA_HOME for that matter.

If this is not your issue, I would suggest trying to open the file directly from the terminal using that same string of text, to make sure that the file is definitely there.

share|improve this answer
    
@user1905811 No i have not installed Tomcat in my library directory, Its is being installed under username. I tried running this command as you mentioned CATALINA_HOME=/Users/username/Library/Tomcat/Home but nothing happened . Still i am not able to launch sh startup.sh –  Ankit Dec 20 '12 at 5:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.