问题描述
我将Apache James用作电子邮件服务器,以便在mac Sierra-v 10.12.3上进行开发
I'm using Apache James as email server for development purpose on mac Sierra - v 10.12.3
当我尝试以超级用户身份启动/运行
When I try to start/run it as super user
sudo ./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.
当我尝试不使用sudo运行它时,我得到以下信息:
When I try to run it without sudo, I get the following:
Using PHOENIX_HOME: /Users/myUserName/Dev/james-2.3.2.1
Using PHOENIX_TMPDIR: /Users/myUserName/Dev/james-2.3.2.1/temp
Using JAVA_HOME: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
Running Phoenix:
Phoenix 4.2
James Mail Server 2.3.2.1
Remote Manager Service started plain:4555
org.apache.avalon.phoenix.containerkit.lifecycle.LifecycleException: Component named "pop3server" failed to pass through the Starting stage. (Reason: java.net.BindException: Permission denied (Bind failed)).
at org.apache.avalon.phoenix.containerkit.lifecycle.LifecycleHelper.fail(LifecycleHelper.java:354)
到目前为止,我知道JAVA_HOME变量已正确设置.
The JAVA_HOME variable has been set correctly so far I know.
当我在终端中键入$ JAVA_HOME时,我得到:
When I type $JAVA_HOME in terminal I get:
-bash: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home: is a directory
在 .profile 和 .bash_profile 文件中我有:
in .profile and .bash_profile files I do have:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
你知道原因是什么吗?
推荐答案
已解决...解决方案是为Sudo设置JAVA_HOME环境变量.这是在/etc/sudoers
上完成的.我用'vi'通过终端编辑文件.
Resolved... the solution was to set the JAVA_HOME Environment Variable for Sudo. and this was done on: /etc/sudoers
. I used 'vi' to edit the file via terminal.
sudo visudo
,然后在环境变量的默认设置"之后添加以下行:
and then adding the following line after the Default settings for Environment Variables:
Defaults env_keep += "JAVA_HOME"
仅此而已.要检查JAVA_HOME环境变量是否已正确设置为sudo,我只是在终端中键入了此命令.
That's all. To Check if the JAVA_HOME Environment Variable has been set correctly for sudo, I just typed this command in the terminal.
sudo printenv
这篇关于无法在Mac Sierra上运行Apache james的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!