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

匿名 (未验证) 提交于 2019-12-03 08:46:08

问题:

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

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

Errors occurred during the build. Errors running builder 'Android Package Builder' on project 'HelloAndroid'. sun/security/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

回答1:

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.

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

  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

    Note A 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 

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

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.



回答2:

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 worked for me:
1. Install sun jvm
2. From terminal execute: 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)

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


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!