发布于 4年前

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
©2020 edoou.com   京ICP备16001874号-3