• Register
1 vote
26 views

Problem:

I am getting this error when I tried to build shadow demo for android:

Building DEX Failed!
G:\Unity\JavaPluginSample\Temp/StagingArea> java -Xmx1024M
-Djava.ext.dirs="G:/AndroidSDK/android-sdk_r09-windows\platform-tools/lib/"
-jar "G:/AndroidSDK/android-sdk_r09-windows\platform-tools/lib/dx.jar"
--dex --verbose --output=bin/classes.dex bin/classes.jar plugins
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

Can anybody help to fix or explain me this error

10 7 2
6,060 points

Please log in or register to answer this question.

1 Answer

2 votes

Answer:

This is usually caused by a bad version of Java being installed on your machine.
Try updating your Java install to the latest version and this will generally solve this issue.

or you can try it :

Go to Start->Control Panel->System->Advanced(tab)->Environment Variables->System Variables->New:
Variable name: _JAVA_OPTIONS
Variable value: -Xmx512M
Variable name: Path
Variable value: ;C:\Program Files\Java\jre6\bin;F:\JDK\bin;
Change this to your appropriate path.

 

11 6 4
34,950 points

Related questions

1 vote
1 answer 39 views
39 views
Problem: I kept on getting this error when building for Android (shadow demo): Building DEX Failed! G:\Unity\JavaPluginSample\Temp/StagingArea> java -Xmx1024M -Djava.ext.dirs="G:/AndroidSDK/android-sdk_r09-windows\platform-tools/lib/" -jar "G:/AndroidSDK/android- ... initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. How to solve this?
asked Mar 27, 2020 LizzyM 6.1k points
1 vote
1 answer 11 views
11 views
Problem: My Java 7 is giving me an error: Minecraft could not reserve enough space for object heap.
asked Apr 26 PkGuy 23.5k points
0 votes
1 answer 51 views
51 views
Why i am seeing this error can someone give me some explanation "Could not reserve enough space for object heap"” and how to resolve this issue.
asked Sep 14, 2020 Daniel Anderson 4k points
0 votes
0 answers 12 views
0 votes
1 answer 1 view
1 view
Problem: The main problem could not reserve enough space for object heap android studio but why?
asked Apr 13 jamuna1 30.2k points
0 votes
1 answer 50 views
50 views
i have come across the Minecraft could not reserve enough space for object heap. How to fix could not reserve enough space for object heap Minecraft?
asked Dec 6, 2020 TeamScript 13.5k points
0 votes
1 answer 2 views
2 views
Problem: I am getting the following exception repeatedly each time I try to run the program. Error occurred during initialization of VM.Could not reserve enough space for object heap. Could not create the Java virtual machine.I tried to increase my virtual memory (page size) and RAM size, but to no avail.How can I eliminate this error?
asked 5 days ago Humaira ahmed 50.7k points
0 votes
1 answer 4 views
4 views
Problem: I am getting the following exception repeatedly each time I try to run the program. Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. I tried to increase my virtual memory (page size) and RAM size, but to no avail. How can I eliminate this error?
asked Apr 23 Yeamin 22k points
1 vote
1 answer 13 views
13 views
Problem: I keep getting this error : Error occurred during initialization of VM Could not reserve enough space for object heap Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. When I try to run this : java -Xmx4G -Xms4G - ... solve this ? I use Java 7 on 32-bit windows . And also java -Xmx1G -Xms1G -jar Minecraft.jar seems to work fine .
asked Apr 21 Raj Tyagi 14.9k points
0 votes
1 answer 18 views
18 views
How can I eliminate this error?
asked Feb 9 TeamScript 13.5k points