Android Studio无法启动 - 无法初始化类javax.crypto.SunJCE_b

时间:2015-03-12 10:44:00

标签: java android android-studio

我下载适用于Mac的Android工作室。当我尝试启动应用程序时,它会在下面抛出异常。 我目前的Java版本是1.8.0_25。

java.lang.NoClassDefFoundError: Could not initialize class javax.crypto.SunJCE_b
    at javax.crypto.KeyGenerator.a(DashoA13*..)
    at javax.crypto.KeyGenerator.<init>(DashoA13*..)
    at javax.crypto.KeyGenerator.getInstance(DashoA13*..)
    at com.sun.net.ssl.internal.ssl.JsseJce.getKeyGenerator(JsseJce.java:223)
    at com.sun.net.ssl.internal.ssl.RSAClientKeyExchange.<init>(RSAClientKeyExchange.java:91)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverHelloDone(ClientHandshaker.java:747)
    at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:241)
    at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)
    at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:529)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:943)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1188)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1215)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1199)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:476)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:133)
    at com.android.tools.idea.welcome.AndroidStudioWelcomeScreenProvider.checkInternetConnection(AndroidStudioWelcomeScreenProvider.java:103)
    at com.android.tools.idea.welcome.AndroidStudioWelcomeScreenProvider.fetchPackages(AndroidStudioWelcomeScreenProvider.java:160)
    at com.android.tools.idea.welcome.AndroidStudioWelcomeScreenProvider.access$100(AndroidStudioWelcomeScreenProvider.java:53)
    at com.android.tools.idea.welcome.AndroidStudioWelcomeScreenProvider$2.compute(AndroidStudioWelcomeScreenProvider.java:149)
    at com.android.tools.idea.welcome.AndroidStudioWelcomeScreenProvider$2.compute(AndroidStudioWelcomeScreenProvider.java:146)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$4.run(ProgressManagerImpl.java:240)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:471)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$6.run(ProgressManagerImpl.java:281)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)

3 个答案:

答案 0 :(得分:0)

尝试使用不同版本的local_policy和US_export_policy jar。 Java Bugdatabase也指引起此错误的损坏的jar。

答案 1 :(得分:0)

卸载并重新安装Java开发工具包(这对我有用)

答案 2 :(得分:0)

Android Studio需要启动JRE 6,尽管您可以在项目后使用JDK 1.6或JDK1.7。 从此处下载Java 6 for Mac并安装然后启动Android Studio。 它有效!!