Android Studio - Gradle - VM初始化期间发生错误

时间:2015-11-24 11:03:33

标签: android jvm java-8 android-gradle apk

我正在尝试使用Mac OS 10.9.5(iMac 2009)上的Android Studio为简单的Java程序生成一个APK文件,并在编译时收到以下错误消息:

08:49:25.337 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
08:49:25.337 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/bin/java'' finished with exit value 1 (state: FAILED)
08:49:25.338 [INFO] [org.gradle.api.Project] Error occurred during initialization of VM
java.lang.NullPointerException
    at java.util.Hashtable.put(Hashtable.java:459)
    at java.lang.System.initProperties(Native Method)
    at java.lang.System.initializeSystemClass(System.java:1166)

我在互联网上查了很多帖子但没有帮助。

我的JAVA_HOME设置为/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home

我的JDK安装有问题吗?或者使用Gradle?

提前多多感谢,

皮尔

根据评论更新:

otool -L /Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/bin/java
/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/bin/java:
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 19.0.0)
    /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 55179.0.2)
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 45.0.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 744.1.0)
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 945.11.0)

我确认/ System / Library / Frameworks文件夹与所有子文件夹一起存在。

0 个答案:

没有答案