Android compilation error: unable to execute DEX: Java heap Space

Source: Internet
Author: User

Yesterday, when compiling and running an application (transplanted) written by a colleague of run as Android Application, the system prompts unable to execute DEX: Java heap space. At first, the android SDK was not installed, so I wrote a hello Android program to verify that Hello android can run.

So I googled it. It is said that it was because the ADT was upgraded (like a reply from the android Team). I switched the latest ADT back to the previous one, or I used the android Team (?) The fixed version is enough (I have not tried this ).

In fact, it is also possible to continue using adt14, which requires modifying the eclipse configuration file, as many people on the Internet say, to modify the eclipse. ini file under the eclipse installation directory:

1) Add at the beginning of the file

-VM
D: \ Program Files \ Java \ jre6 \ bin \ javaw.exe

Where, D: \ Program Files \ Java \ jre6 is the path of the JRE on my machine and needs to be modified according to the actual situation

2) search-launcher. xxmaxpermsize and set

256 m

Change

512 m

The parts marked in red may be of different eclipse versions, and the numbers (256) are different.

3) search-vmargs

-Vmargs
-Xms40m
-Xmx384m

Set

-Xms40m
-Xmx384m

Change

-Xms512m
-Xmx1024m

And add

-XX: maxpermsize = 256 m

As shown in the preceding figure, different versions of eclipse may have different numbers (40 and 384) marked in red.

Restart eclipse and compile the project with an error.

Some people on the Internet say this is not feasible. I don't know if it is because the author of the original article does not have a detailed description of how to modify it, because this problem has been solved on my machine. ^_^

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.