Lỗi could not create the java virtual machine

      1,098

Some users are encountering the Could Not Create The Java Virtual Machine error when trying khổng lồ launch an application that is using Java. This particular issue is reported to lớn occur with Minecraft và several other applications that are built around Java.

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

*
Could not create the Java Virtual Machine.Error: A fatal exception has occurred. The program will exit.

What is causing the Could Not Create The Java Virtual Machine error?

We investigated this particular issue by looking at various user reports and the troubleshooting strategies that they used to resolve sầu the same error message. Based on their conclusions, there are a couple of scenartiện ích ios that will trigger this particular issue:
Java is invoked by the wrong arguments or options – This can occur if you’re running a home-brewed application or you’re trying khổng lồ open an open-source application that is known lớn cause system instability.Java global maximum heap memory is not high enough – One of the most comtháng causes of why you can encounter this particular error is if you try lớn start a Java application with a maximum heap memory size larger than the one phối as the System Variable.Java executable and/or application require administrative sầu privileges – This might happen with applications that need admin access in order to lớn function properly.
If you’re currently looking for a way lớn resolve sầu the, Could Not Create The Java Virtual Machine error, this article will provide you with several verified troubleshooting strategies. Below you have a collection of methods that other users in a similar situation have used khổng lồ get the issue resolved.


To ensure the best results, follow the methods below in the order that they are presented until you discover a method that is effective sầu in resolving the error for your particular scenario.

Method 1: Adding the _JAVA_OPTIONS lớn System Variables

Most affected users have managed lớn get the issue resolved by creating a System Variable for Java called _JAVA_OPTIONS and setting it’s value to Xmx512M. What this essentially does is it sets the global maximum heap memory kích cỡ for Java.

This will resolve sầu any error message that occurs because the started Java application’s maximum heap memory kích thước is larger than the one set as the System Variable. Several users encountering the same issue have sầu reported that the issue was resolved entirely after they performed the steps below.

Here’s what you need lớn do lớn add a _JAVA_OPTIONS entry in System Variables to lớn enlarge the global maximum heap memory size:

Press Windows key + R khổng lồ open up a Run dialog box. Then, type “sysdm.cpl” và press Enter to lớn open up the System Properties screen.Inside the System Properties screen, go khổng lồ the Advanced tab and cliông chồng on Environment Variables.In the Environment Variables window, cliông xã on New (under System Variables).Inside the New System Variable window, set the Variable name khổng lồ _JAVA_OPTIONS & the Variable value to –Xmx512M and click Ok to save the changes.Cđại bại the previously opened windows và restart your machine to enforce the changes.At the next startup, open the application that was previously showing you the Could Not Create the Java Virtual Machine error & see if is now functioning properly.
*
Creating a System Variable called _JAVA_OPTIONS & assigning it the value Xmx512M

If you’re still seeing the same error message at the start of the application, try adding the Java Bin path which might be similar to “%USER PATHJavajdk1.6.0_39in” to the environment variable as indicated in the above sầu method and see if that works.

Xem thêm: Kiếm Tiền Qua Google Adsense, Các Mẹo Kiếm Tiền Từ Google Adsense

Method 2: Opening java.exe with admin rights 

Several users struggling khổng lồ resolve the same issue have sầu managed lớn get the issue resolved after forcing the main Java executable (java.exe) khổng lồ open with administrative sầu privileges.

Some users reported that they were able to lớn resolve the issue after applying this fix on both the main java executable and the executable of the application that is showing the error message.

Here’s a quiông chồng guide through the whole thing:

xuất hiện File Explorer and navigate to lớn the location of your java installation. We’ll need to lớn arrive sầu at the location of the main Java executable (java.exe). By default, you should find it in Program Files/Java/*JRE build version*/bin. The exact location will differ depending on which Java Runtime Environment you’re using.
*
Navigate to lớn the location of java.exe

Note: If you installed Java in a custom location, navigate the custom location instead.Right-clichồng on java.exe và choose Properties. Then, go khổng lồ the Compatibility tab and check the box associated with Run this program as an administrator (under Settings). Click Apply to lớn save sầu the changes.

*
go to the Compatibility tab và enable Run this program as an administratorRight-cliông chồng on the application executable (the one that is triggering the error) and repeat the same procedure: Compatibility > Run this program as an administrator > Apply.Run the application and see if the error message is resolved.

Method 3: Reinstalling Java

In some cases, the error is triggered because Java might not be installed properly or its installation might have been corrupted over time. Therefore, in this step, we will be reinstalling Java after uninstalling it completely. For that:


Press Windows key + R lớn open up the Run prompt & type in “Appwiz.cpl”.Type “appwiz.cpl” into lớn the Run dialog và press EnterPress “Enter” và the Programs & Features screen will open up.At the Programs and Features screen, scroll through the installed application danh mục until you find Java.Checking the Programs and features screenRight-click on it & select “Uninstall” lớn remove it completely from the systemFirst, delete the primary Java installation & later you should also remove all other Java installations such as updates and other versions.After uninstalling all installation, restart your computer.Check khổng lồ see if the issue persists.Verify if the issue still exists.

Method 4: Fixing Errors With Code

There are different reasons behind this error và some of them include if you have some particular errors with your code. We will highlight some below.

Remove Hyphen: Some users noted that the error was fixed by changing the double hyphen “–” to lớn a single one “-” in their code. For example:Change the code“sony
sony-VPCEH25EN:~$ java –versionPicked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jarUnrecognized option: –versionError: Could not create the Java Virtual Machine.Error: A fatal exception has occurred. Program will exit.”To“sony
sony-VPCEH25EN:~$ java -versionPicked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jarUnrecognized option: –versionError: Could not create the Java Virtual Machine.Error: A fatal exception has occurred. Program will exit.”Also, Try removing the following line from your argument-Djava.endorsed.dirs=”C:Program FilesApache Software FoundationTommèo 8.5endorsed”Open your eclipse.ini tệp tin và make sure that you add the “-vm” entry above sầu the vm args otherwise, JVM V6 will be selected in env vars.If on Ubuntu, you should know that Java 8 is the only version that is supported. Therefore, using the third method. Uninstall Java, và install the previous version.

Method 5: Editing Eclipse.ini File

We can also tweak things inside the Eclipes.ini File lớn get rid of this issue. There might be a couple of issues with its configuration that need to be addressed therefore, we have sầu divided it inkhổng lồ separate issues. Follow the one which suits your scenario the best.

Lowering Memory Use

xuất hiện the Eclipse.ini file inside the Eclipse folder with notepad.Find the line similar to lớn “-Xmx256m” (It might be -Xmx1024m or -Xmx 512m).Now change the default value to a more reasonable figure depending upon the RAM installed on your computer and add the version number khổng lồ it as well. For Example:

-Xmx512m-Dosgi.requiredJavaVersion=1.6OR-Xmx512m-Dosgi.requiredJavaVersion=1.7OR-Xmx512m-Dosgi.requiredJavaVersion=1.8Also, try removing the “256m” value from the “-launcher.XXMaxPermSize” line.Chechồng to see if the issue persists.

Tinkering Around

Try to lớn remove sầu the following lines from your file.-vm P:Programsjdk1.6inAlso, change the following lines.set -Dosgi.requiredJavaVersion=1.5TOmix -Dosgi.requiredJavaVersion=1.6Also, try adding the following line above “-vmargs!” line.-vm C:Program Files (x86)Javajre6injavaw.exeAlso, point khổng lồ JVM.dll using the following line.-vmC:Program FilesJavajre7inclientjvm.dllxuất hiện the Eclipse tệp tin & replace “-vmargs” with the path of javaw.exe cộ. For Example:-startupplugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar--launcher.libraryplugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120522-1813-productcom.apk.ide.eclipse.adt.package.product--launcher.XXMaxPermSize256M-showsplashcom.android.ide.eclipse.adt.package.product--launcher.XXMaxPermSize256m--launcher.defaultActionopenFile**-vm “c:Program FilesJavajdk1.7.0_07injavaw.exe”** -Dosgi.requiredJavaVersion=1.6-Xms40m-Xmx768m-Declipse.buildId=v21.1.0-569685Also, you can place the following line at the end và check if that works.-vmargs-Xms40m-Xmx512m-XX:MaxPermSize=256mFurthermore, try removing the following lines from the eclipse.ini and kiểm tra if that works.-XX:+UseStringDeduplication-XX:+UseG1GCYou can also try removing the eclipse.ini file if the issue still persists as that has reportedly fixed the issue for some but remember to lớn baông xã it up first just in case you need it. Also, try closing all the power-hungry applications before starting Java khổng lồ make sure proper resources are available.

Xem thêm: Khóa Học: Trọn Bộ Kiến Thức Nodejs Gv Nhữ Bảo Vũ, Trọn Bộ Kiến Thức Nodejs Gv Nhữ Bảo Vũ

Checking for JDK Corruption

Press “Windows” + “R” to open the Run prompt and type in “cmd”.Type in the following commvà & check if that gives an error.c:> java -versionIf it does give sầu an error, reinstall the JDK completely.

Chuyên mục: Domain Hosting