LỖI COULD NOT CREATE THE JAVA VIRTUAL MACHINE

This tutorial explains how you can fix Java virtual machine creation errors on Windows.

Bạn đang xem: Lỗi could not create the java virtual machine

Every now and then I lượt thích lớn play a relaxing computer game, and the excellent strategy game TripleA was my game of choice yesterday. It is a Java-based game but since the machine I wanted to lớn run it on had Java (only untied from the browser) , I did not think that this would be an issue.

When I tried to lớn start the game though after installation it quit immediately afterwards. The error message that it displayed was definitely Java related:

Error: Could not create the Java Virtual Machine


Error: A fatal exception has occurred. Program will exit.

First thing I did was double-kiểm tra to make sure that Java was indeed properly installed - it was. It was the most recent version và the game should just run fine using it according to the game"s trang web.

*

After some digging around and testing I came up with a solution for the issue that worked and resolved the error message so that the Java application started just fine. It involves changing how much memory Java is allowed to lớn use on the system.

Xem thêm: Chi Tiết Cách Đồng Bộ Danh Bạ Trên Android Lên Gmail, Cách Đồng Bộ Danh Bạ Android Lên Gmail


Java on Windows uses an initial form size of 16 Megabyte & a maximum of 64 Megabyte. You can find that out by yourself by running the commvà java -XX:+PrintFlagsFinal -version on your machine. Check the InitialHeapSize & MaxHeapSize values here (displayed in Bytes).

Now, to lớn resolve the error message we need to increase the kích thước that Java can use for memory. Here is how that is done (demonstrated using Windows 7, may differ slightly on other versions of Windows):

Tap on Windows-Pause to lớn open the System Control Panel applet. You can alternatively open the control panel manual to lớn go there if you prefer it that way.Cliông xã on advanced system settings on the left.Select environmental variables here.Cliông chồng on new under System Variables.Enter _JAVA_OPTIONS as the variable name.Enter -Xmx256M as the variable value.Cliông chồng ok twice.

The setting is available right away, you do not need to lớn restart the computer first. It raises the allowed memory khổng lồ 256 Megabyte. If your application does not run fine afterwards, try raising the memory to 512 or even 1024 Megabyte instead.


Note that this increases the maximum heap kích cỡ only. If you also need lớn increase the minimum heap form size, use -Xms256M for that.