发布于 5年前
                Mac系统运行gradle项目遇到JAVA_HOME is set to an invalid directory:
ERROR: JAVA\_HOME is set to an invalid directory: /Library/Java/JavaVirtualMachines/1.8.0\_121.jdk/Contents/Home解决方法
在终端中输入两行命令:
export JAVA\_HOME=`/usr/libexec/java\_home  
echo export “JAVA\_HOME=$(/usr/libexec/java\_home)” >> ~/.bash\_profile 
             
             
             
             
            