eclipse 在项目“HelloAndroid”上运行构建器“Android Package Builder”时出错。太阳/安全/x509/X500Name

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10684318/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 18:14:01  来源:igfitidea点击:

Errors running builder 'Android Package Builder' on project 'HelloAndroid'. sun/security/x509/X500Name

androideclipseadt

提问by Zeeshan Rang

I just installed Eclipse-Classic 3.7.2 and android SDK. Also installed/configured eclipse with ADT plugin.

我刚刚安装了 Eclipse-Classic 3.7.2 和 android SDK。还安装/配置了带有 ADT 插件的 Eclipse。

Now after following the steps in http://developer.android.com/resources/tutorials/hello-world.htmlto create a "Hello World" application I tried to run the application in Android Emulator. But this is throwing an error

现在按照http://developer.android.com/resources/tutorials/hello-world.html 中的步骤创建“Hello World”应用程序后,我尝试在 Android Emulator 中运行该应用程序。但这会引发错误

Errors occurred during the build. Errors running builder 'Android Package Builder' on project 'HelloAndroid'. sun/security/x509/X500Name

构建过程中发生错误。在项目“HelloAndroid”上运行构建器“Android Package Builder”时出错。太阳/安全/x509/X500Name

Can you please explain me what am I doing wrong here, or what do I need to fix for this error.

你能解释一下我在这里做错了什么,或者我需要修复这个错误。

Thank you Zeeshan

谢谢泽山

采纳答案by Agustin Altamirano

The problem is related with the JVM you are working with, but also the certificate that have to be generated with the keytool from this JVM.

该问题与您正在使用的 JVM 相关,还与必须使用来自该 JVM 的 keytool 生成的证书有关。

Here you are the commands i have used to solve this problem in my Linux Ubuntu v11.04 system:

这是我在 Linux Ubuntu v11.04 系统中用来解决此问题的命令:

  1. I have installed the Oracle/Sun SDK 1.6 ( SDK not the JRE one ) on my computer.

  2. I made this new SUN JVM the default with the following instruction

    sudo update-alternatives --config java

    NoteA list is shown with all the available JVM on your system, select the SUN one.

  3. Now you will be able to execute this command with the JVM provided by SUN:

    keytool -genkey -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -validity 14000
    
  1. 我已经在我的计算机上安装了 Oracle/Sun SDK 1.6(SDK 不是 JRE)。

  2. 我使用以下指令将这个新的 SUN JVM 设为默认值

    须藤更新替代品--config java

    注意显示了系统上所有可用 JVM 的列表,选择 SUN 之一。

  3. 现在您将能够使用 SUN 提供的 JVM 执行此命令:

    keytool -genkey -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -validity 14000
    

NoteYou should delete the old debug.keystore file before you execute this command, or rename it as you wish.

注意您应该在执行此命令之前删除旧的 debug.keystore 文件,或者根据需要重命名它。

Now that your system is up and running, then you need to configure your new JVM in Eclipse in order to compile with this new version.

既然您的系统已启动并运行,那么您需要在 Eclipse 中配置您的新 JVM,以便使用这个新版本进行编译。

回答by pushkarajthorat

In my case, the ADT plugin was trying to use keytool utility present in JVM which launched eclipse. Which was IBM JDK, this failed as keytool which comes with IBM JDK is incompatible with the Sun version -- it has its a syntax that doesn't match the Google documentation, and it automatically creates the keystore file in ~/.keystore (without actually telling you where it was created).

Below solution workedfor me:
1. Install sun jvm
2. From terminal execute: eclipse -vm path_to_sun_java/javaw

就我而言,ADT 插件试图使用启动 eclipse 的 JVM 中存在的 keytool 实用程序。哪个是 IBM JDK,这失败了,因为 IBM JDK 附带的 keytool 与 Sun 版本不兼容——它的语法与 Google 文档不匹配,并且它会自动在 ~/.keystore 中创建密钥库文件(没有实际上告诉你它是在哪里创建的)。

以下解决方案对我
有用: 1. 安装 sun jvm
2. 从终端执行: eclipse -vm path_to_sun_java/javaw

Instead of step 2, you can edit eclipse.ini to tell which jvm to use (ref eclipse.ini)

您可以编辑 eclipse.ini 来判断要使用哪个 jvm,而不是第 2 步(参考eclipse.ini

-vm
/usr/lib/sunjdk/bin/javaw