title: Unable to compile Android hello world on Netbeans
body: <p>This is my very first post on this extremely helpful site!</p>
  
  <p>After 30 minutes of Googling and discovering the very helpful automated search function as you type your question's name, I figured it's time I finally made an account and ask!</p>
  
  <p>Alright, this is the first time I'm getting my hands dirty, and I saw hit with an error straight in my face, in the form of:</p>
  
  <p>I understand some coding concepts, however I'm still extremely new and I'd like to learn what's causing this to happen from the helpful people on this site, thanks!</p>
  
  <pre><code>clean:
  Deleting directory C:\Users\User\Documents\NetBeansProjects\AndroidApplication1\bin
  Deleting directory C:\Users\User\Documents\NetBeansProjects\AndroidApplication1\gen
  Creating output directories if needed...
  Created dir: C:\Users\User\Documents\NetBeansProjects\AndroidApplication1\bin
  Created dir: C:\Users\User\Documents\NetBeansProjects\AndroidApplication1\bin\res
  Gathering info for AndroidApplication1...
  Android SDK Tools Revision 19
  Project Target: Google APIs
  Vendor: Google Inc.
  Platform Version: 2.3.3
  API level: 10
  ------------------
  Resolving library dependencies:
  No library dependencies.
  
  ------------------
  API&lt;=15: Adding annotations.jar to the classpath.
  
  ------------------
  WARNING: No minSdkVersion value set. Application will install on all Android versions.
  Created dir: C:\Users\User\Documents\NetBeansProjects\AndroidApplication1\gen
  Created dir: C:\Users\User\Documents\NetBeansProjects\AndroidApplication1\bin\classes
  ----------
  Handling aidl files...
  No AIDL files to compile.
  ----------
  Handling RenderScript files...
  No RenderScript files to compile.
  ----------
  Handling Resources...
  Generating resource IDs...
  ----------
  Handling BuildConfig class...
  Generating BuildConfig class.
  Compiling 3 source files to C:\Users\User\Documents\NetBeansProjects\AndroidApplication1\bin\classes
  Converting compiled files and external libraries into C:\Users\User\Documents\NetBeansProjects\AndroidApplication1\bin\classes.dex...
  Error: Could not create the Java Virtual Machine.
  Error: A fatal exception has occurred. Program will exit.
  Error occurred during initialization of VM
  Could not reserve enough space for object heap
  C:\Program Files\Android\android-sdk\tools\ant\build.xml:818: The following error occurred while executing this line:
  C:\Program Files\Android\android-sdk\tools\ant\build.xml:820: The following error occurred while executing this line:
  C:\Program Files\Android\android-sdk\tools\ant\build.xml:832: The following error occurred while executing this line:
  C:\Program Files\Android\android-sdk\tools\ant\build.xml:278: null returned: 1
  BUILD FAILED (total time: 3 seconds)
  </code></pre>
  
  <p>And the lines where the error happened on:</p>
  
  <p>C:\Program Files\Android\android-sdk\tools\ant\build.xml</p>
  
  <pre><code>&lt;!-- Converts this project's .class files into .dex files --&gt;
      &lt;target name="-dex" depends="-compile, -post-compile, -obfuscate"&gt;
  818     &lt;do-only-if-manifest-hasCode elseText="hasCode = false. Skipping..."&gt;
              &lt;!-- only convert to dalvik bytecode is *not* a library --&gt;
  820         &lt;do-only-if-not-library elseText="Library project: do not convert bytecode..." &gt;
                  &lt;!-- special case for instrumented builds: need to use no-locals and need
                       to pass in the emma jar. --&gt;
                  &lt;if condition="${build.is.instrumented}"&gt;
                      &lt;then&gt;
                          &lt;dex-helper nolocals="true"&gt;
                              &lt;external-libs&gt;
                                  &lt;fileset file="${emma.dir}/emma_device.jar" /&gt;
                              &lt;/external-libs&gt;
                          &lt;/dex-helper&gt;
                      &lt;/then&gt;
                      &lt;else&gt;
  832                     &lt;dex-helper /&gt;
                      &lt;/else&gt;
                  &lt;/if&gt;
              &lt;/do-only-if-not-library&gt;
          &lt;/do-only-if-manifest-hasCode&gt;
      &lt;/target&gt;
  
  &lt;!-- Configurable macro, which allows to pass as parameters output directory,
           output dex filename and external libraries to dex (optional) --&gt;
      &lt;macrodef name="dex-helper"&gt;
          &lt;element name="external-libs" optional="yes" /&gt;
          &lt;attribute name="nolocals" default="false" /&gt;
          &lt;sequential&gt;
              &lt;!-- sets the primary input for dex. If a pre-dex task sets it to
                   something else this has no effect --&gt;
              &lt;property name="out.dex.input.absolute.dir" value="${out.classes.absolute.dir}" /&gt;
  
              &lt;!-- set the secondary dx input: the project (and library) jar files
                   If a pre-dex task sets it to something else this has no effect --&gt;
              &lt;if&gt;
                  &lt;condition&gt;
                      &lt;isreference refid="out.dex.jar.input.ref" /&gt;
                  &lt;/condition&gt;
                  &lt;else&gt;
                      &lt;path id="out.dex.jar.input.ref"&gt;
                          &lt;path refid="project.libraries.jars" /&gt;
                      &lt;/path&gt;
                  &lt;/else&gt;
              &lt;/if&gt;
  
              &lt;dex executable="${dx}"
                      output="${intermediate.dex.file}"
                      nolocals="@{nolocals}"
  278                 verbose="${verbose}"&gt;
                  &lt;path path="${out.dex.input.absolute.dir}"/&gt;
                  &lt;path refid="out.dex.jar.input.ref" /&gt;
                  &lt;external-libs /&gt;
              &lt;/dex&gt;
          &lt;/sequential&gt;
      &lt;/macrodef&gt;
  </code></pre>