1

I downloaded TomEE zip file, extract it. The directory structure is like this:

apache-tomee-webprofile-7.0.1/
            - bin/
                -startup.sh

I added the following thing in my .bash_profile

export CATALINA_HOME=apache-tomee-webprofile-7.0.1
export PATH=$PATH:$CATALINA_HOME/bin

I run source .bash_profile . Then, I run startup.sh But I get error:

-bash: startup.sh: command not found

I then tried to run $CATALINA_HOME/bin/startup.sh , I get error:

-bash: apache-tomee-webprofile-7.0.1/bin/startup.sh: No such file or directory

How to run startup.sh ?

4
  • 2
    Most likely your current directory is not directly above the expanded tomee files. Make CATALINA_HOME an absolute path and try again.
    – Jeff Schaller
    Aug 14, 2016 at 12:07
  • @JeffSchaller may as well post that as an answer.
    – terdon
    Aug 14, 2016 at 12:19
  • @JeffSchaller, how to make CATALINA_HOME an absolute path? Could you please be more specific?
    – Mellon
    Aug 14, 2016 at 12:53
  • See my Answer....
    – Jeff Schaller
    Aug 14, 2016 at 12:54

1 Answer 1

2

It's not explicit in your question, but you would get that "No such file or directory" error if you ran startup.sh from any directory other than the one that's directly above apache-tomee-webprofile-7.0.1 because you've set CATALINA_HOME to apache-tomee-webprofile-7.0.1 which is not an absolute path.

The reason this matters is because you then use it in PATH, which your shell uses to find executables. If there's a piece of the PATH variable that is not absolute (starts with /), then your shell will append that piece to your current directory.

The fix is simple -- make CATALINA_HOME have an absolute path as its value. Change directory into the expanded apache-tomee-webprofile-7.0.1 and run:

pwd

then use that resulting value in your .bash_profile as the CATALINA_HOME value.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .