I'm trying to run the James SMTP server on Lion (Mac OS X 10.7.2). When I do this:
sudo JAVA_HOME=/Library/Java/Home ./james-2.3.2/bin/run.sh
it works fine.
However, I'd like to make JAVA_HOME an environment variable so it is visible to other applications too.
I edited ~/.bash_profile to look like this:
export JAVA_HOME=/Library/Java/home
and the variable appears to be visible from the command line like so:
$ echo $JAVA_HOME
/Library/Java/home
But when I run james again like this, I get a warning about JAVA_HOME:
$ sudo ./james-2.3.2/bin/run.sh
ERROR: JAVA_HOME not found in your environment.
Please, set the JAVA_HOME variable in your environment to match the
location of the Java Virtual Machine you want to use.
Any ideas what I'm doing wrong? Why can't the command to run james see the JAVA_HOME environment variable?
Any info is greatly appreciated, thanks!
-E
, preserve environment flag.