mac gradle遇到问题

来源:互联网 发布:node path resolve 编辑:程序博客网 时间:2024/04/25 15:55

FAILURE: Build failed with an exception.

  • What went wrong:
    Failed to load native library ‘libnative-platform.dylib’ for Mac OS X x86_64.

  • Try:
    Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output.

查看用户目录下.gradle是否有权限

ls ~/.gradle

如果没有权限 ,简单起见,我全加上权限了

sudo chmod -R 777 .gradle

接下来,还遇到了问题
FAILURE: Build failed with an exception.

  • What went wrong:
    Gradle 3.1 requires Java 7 or later to run. You are currently using Java 6.

  • Try:
    Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output.

简单,切换下java版本,看下用哪些java版本。

/usr/libexec/java_home -V

Matching Java Virtual Machines (4):    1.8.0_101, x86_64:  "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home    1.7.0_79, x86_64:   "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home    1.6.0_65-b14-468, x86_64:   "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home    1.6.0_65-b14-468, i386: "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home

修改下java_home,对应的1.8可以改成你要的版本,1.6.0_65-b14-468,或1.8都行。

export JAVA_HOME=
/usr/libexec/java_home -v 1.8

0 0
原创粉丝点击