Solution to error 41 during Android Compilation

Source: Internet
Author: User

I encountered this error. I saw the solution in a Foreign Forum and successfully solved the problem. I hope to help others.

Error:
Build/CORE/product_config.mk: 229: Warning: adding test OTA key
Host Java: clearsilver (Out/host/common/obj/java_libraries/
Clearsilver_intermediates/classes)
Unrecognized option: 9999999
Make: *** [out/host/common/obj/java_libraries/
Clearsilver_intermediates/javalib. jar] Error 41

Cause:
According to the error message, it is probably a Java Virtual Machine problem. Some people say that I have installed Java, but it cannot be used. "androidrequires at least java5 with update 12...", I installed Java 6, no problem.

Solution:
After installing Java 6
1. Configure the Java environment variable. I installed it with the new version in ubuntu8.04. The default path is/usr/lib/JVM/Java-6-sun.
Open the. bashrc file under the root user
# Vi ~ /. Bashrc
Add

Export java_home =/usr/lib/JVM/Java-6-sun
Export android_java_home = $ java_home

Save and exit

2. Use the update-alternatives command to change the correct path to the Java service. Because we may have installed several services that can provide Java, although Java 6 is installed, the path has not been changed, the system still uses the old path, so during Android editing, the version is incorrect.
Modification example (replace alternatives with update-alternatives in Ubuntu ):
[Root @ vostro ~] # Alternatives -- config Java
There are 3 programs which provide 'java '.
Selection command
-----------------------------------------------
* + 1/usr/lib/JVM/jre-1.6.0-openjdk/bin/Java
2/usr/lib/JVM/jre-1.5.0-gcj/bin/Java
3/usr/Java/jdk1.6.0 _ 07/bin/Java
Enter to keep the current selection [+], or type selection number: 3

[Root @ vostro ~] # Alternatives -- config javac

There is 1 program that provides 'javac '.
Selection command
-----------------------------------------------
* + 1/usr/lib/JVM/java-1.5.0-gcj/bin/javac
Enter to keep the current selection [+], or type selection Number:
[Root @ vostro ~] # Alternatives -- config javac
There are 2 programs which provide 'javac '.
Selection command
-----------------------------------------------
* + 1/usr/lib/JVM/java-1.5.0-gcj/bin/javac
2/usr/Java/jdk1.6.0 _ 07/bin/javac
Enter to keep the current selection [+], or type selection number: 2

[Root @ vostro ~] # Javac-version
Javac 1.6.0 _ 07

[Root @ vostro ~] # Alternatives -- config jar

There is 1 program that provides 'jar '.
Selection command
-----------------------------------------------
* + 1/usr/Java/jdk1.6.0 _ 07/bin/jar
Enter to keep the current selection [+], or type selection Number:

Provide Java, javac, change all program paths of the jar service to jdk1.6.0 _ 07 (my files are/usr/lib/JVM/Java-6-sun/JRE/bin/Java ), that is, * and + are all moved to that location. In my system, only default selection can be changed. Later, I deleted other paths using Update-alternatives -- remove, current selection [+] has been changed. How to delete it is helpful.

Finally, restart (logout/login may be required) to make the job. Enjoy it

This article is not original, from http://www.androidin.com/bbs/redirect.php? Tid = 2682 & goto = lastpost

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.