
When that happens, the easiest solution that has been tested on both Windows XP, Windows 7 and Windows 8 is:
- Open the Control Panel
- Go to System
- Go to Advanced Systems Properties
- Then Environment Variables
- In System Variables, click Add
- New Variable Name: _JAVA_OPTIONS
- New Variable Value: -Xmx512M
- Click OK
That's it, your Java program should now be able to execute properly.
For those interested, Java -Xmx/s is the configuration parameter that control the amount of memory Java uses.
- Xmx sets the maximum heap memory size
- Xms sets the minimum heap memory size
See http://www.jafaloo.com/2011/10/30/java-xmx-memory-setti... for more details on Java Heap memory size and parameters.
Related resources
- How do i solve the Java error: could not create java virtual machine? solution
- Java won't run at all (Error: Could not create the Java Virtual Machine.) solution
- Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. Forum
- My minecraft can't create a Java Virtual machine. Please help solution
- How to fix # The crash happened outside the Java Virtual Machine in native code. solution