No valid Maven installation found. Either set the
No valid Maven installation found. Either set the home directory in the configuration dialog or set the M2_HOME environment variable on your system. 最近接手了一个新的JAVA项目,在IDEA中配置好了Debug了,点击Debug,在控制台报错如下: ? 1 [FATAL_ERROR] Cannot start Maven: No valid Maven installation found. Either set the home directory in the <ahref="#">configuration dialog</a> or set the M2_HOME environment variable on your system. 我以前的项目都可以正常使用Maven,这个项目居然不能使用了,我的~/.zshrc一切配置都正常,真是奇怪了。后来去stackoverflow上查了下,原来是Mac的Shell环境变量未必能够被GUI应用读到。解决方法如下: ? 1 sudovim/etc/launchd.conf //一般Mac上默认是没有这个文件的 在这个文件中加上你的M2_HOME的配置: ? 1 setenv M2