Could not create the java virtual machine что делать
Перейти к содержимому

Could not create the java virtual machine что делать

  • автор:

Исправлено: не удалось создать виртуальную машину Java.

Некоторые пользователи сталкиваются с ошибкой «Не удалось создать виртуальную машину Java» при попытке запустить приложение, использующее Java. Сообщается, что эта конкретная проблема возникает с Minecraft и несколькими другими приложениями, построенными на Java.

Не удалось создать виртуальную машину Java. Ошибка. Произошло фатальное исключение. Программа будет закрыта.

Что вызывает ошибку «Не удалось создать виртуальную машину Java»?

Мы исследовали эту конкретную проблему, изучив различные отчеты пользователей и стратегии устранения неполадок, которые они использовали для устранения одного и того же сообщения об ошибке. Основываясь на их выводах, существует несколько сценариев, которые могут вызвать данную проблему:

  • Java вызывается из-за неправильных аргументов или опций. Это может произойти, если вы запускаете самодельное приложение или пытаетесь открыть приложение с открытым исходным кодом, которое, как известно, вызывает нестабильность системы.
  • Глобальный максимальный размер кучи Java недостаточно высок. Одна из наиболее частых причин, по которой вы можете столкнуться с этой конкретной ошибкой, — это попытка запустить приложение Java с максимальным размером памяти кучи, превышающим тот, который задан как системная переменная .
  • Исполняемый файл Java и / или приложение требуют прав администратора — это может происходить с приложениями, которым для правильной работы требуется доступ администратора.

Если вы в настоящее время ищете способ устранить ошибку « Не удалось создать виртуальную машину Java» , эта статья предоставит вам несколько проверенных стратегий устранения неполадок. Ниже приведен набор методов, которые другие пользователи в аналогичной ситуации использовали для решения проблемы.

Чтобы обеспечить наилучшие результаты, следуйте приведенным ниже методам в том порядке, в котором они представлены, пока не найдете метод, эффективный для устранения ошибки для вашего конкретного сценария.

Метод 1: добавление _JAVA_OPTIONS в системные переменные

Наиболее затронутым пользователям удалось решить проблему, создав системную переменную для Java с именем _JAVA_OPTIONS и установив для нее значение Xmx512M . По сути, это устанавливает глобальный максимальный размер кучи для Java.

Это устранит любое сообщение об ошибке, возникающее из-за того, что максимальный размер кучи запущенного приложения Java больше, чем тот, который задан как системная переменная. Несколько пользователей, столкнувшихся с той же проблемой, сообщили, что проблема была полностью решена после того, как они выполнили указанные ниже действия.

Вот что вам нужно сделать, чтобы добавить запись _JAVA_OPTION S в системные переменные для увеличения глобального максимального размера кучи:

  1. Нажмите клавишу Windows + R, чтобы открыть диалоговое окно « Выполнить ». Затем введите « sysdm.cpl » и нажмите Enter, чтобы открыть экран « Свойства системы» .
  2. На экране « Свойства системы» перейдите на вкладку « Дополнительно » и нажмите « Переменные среды».
  3. В окне « Переменные среды» нажмите « Создать» (в разделе « Системные переменные» ).
  4. В окне « Новая системная переменная» установите для имени переменной значение _JAVA_OPTIONS и значение переменнойXmx512M и нажмите « ОК», чтобы сохранить изменения.
  5. Закройте ранее открытые окна и перезагрузите компьютер, чтобы изменения вступили в силу.
  6. При следующем запуске откройте приложение, которое ранее показывало ошибку « Не удалось создать виртуальную машину Java», и посмотрите, правильно ли работает.

Если вы все еще видите то же сообщение об ошибке в начале приложения, попробуйте добавить путь Java Bin, который может быть похож на «% \ USER PATH \ Java \ jdk1.6.0_39 \ bin», к переменной среды, как указано в описанный выше метод и посмотрите, работает ли он.

Метод 2: открытие java.exe с правами администратора

Нескольким пользователям, пытающимся решить одну и ту же проблему, удалось решить проблему после принудительного открытия основного исполняемого файла Java (java.exe) с правами администратора.

Некоторые пользователи сообщили, что им удалось решить проблему после применения этого исправления как к основному исполняемому файлу Java, так и к исполняемому файлу приложения, в котором отображается сообщение об ошибке.

Вот краткое руководство по всему этому:

    Откройте проводник и перейдите к месту установки Java. Нам нужно будет добраться до места расположения основного исполняемого файла Java ( java.exe ). По умолчанию вы должны найти его в Program Files / Java / * JRE build version * / bin. Точное расположение будет отличаться в зависимости от того, какую среду выполнения Java вы используете.Перейдите к местоположению java.exe

Примечание. Если вы установили Java в произвольном месте, перейдите в это место.

Метод 3: переустановка Java

В некоторых случаях ошибка возникает из-за того, что Java могла быть установлена ​​неправильно или ее установка могла быть повреждена с течением времени. Следовательно, на этом этапе мы переустановим Java после ее полного удаления. Для этого:

  1. Нажмите клавишу Windows + R, чтобы открыть окно «Выполнить», и введите «Appwiz.cpl».
  2. Нажмите «Enter», и откроется экран «Программы и компоненты».
  3. На экране « Программы и компоненты» прокрутите список установленных приложений, пока не найдете Java.
  4. Щелкните его правой кнопкой мыши и выберите «Удалить», чтобы полностью удалить его из системы.
  5. Сначала удалите основную установку Java, а позже вы также должны удалить все другие установки Java, такие как обновления и другие версии.
  6. После удаления всей установки перезагрузите компьютер.
  7. После загрузки перейдите по этой ссылке и загрузите последнюю версию JRE.
  8. Проверьте, сохраняется ли проблема.
  9. Если ошибка не исчезла, загрузите и установите последнюю версию JDK отсюда.

Примечание. Если вы уже используете JDK, попробуйте изменить его версию или удалить JRE, установленную вместе с ним.

Метод 4: исправление ошибок с помощью кода

У этой ошибки есть разные причины, и некоторые из них включают в себя определенные ошибки в вашем коде. Мы выделим некоторые из них ниже.

    Удаление дефиса : некоторые пользователи отметили, что ошибка была исправлена ​​путем замены двойного дефиса «-» на одинарный «-» в их коде. Например:

$ java –версия

Подобрал JAVA_TOOL_OPTIONS: -javaagent: /usr/share/java/jayatanaag.jar

Нераспознанный вариант: –версия

Ошибка: не удалось создать виртуальную машину Java.

Ошибка: возникла фатальная исключительная ситуация. Программа будет закрыта.»

$ java -version

Подобрал JAVA_TOOL_OPTIONS: -javaagent: /usr/share/java/jayatanaag.jar

Нераспознанный вариант: –версия

Ошибка: не удалось создать виртуальную машину Java.

Ошибка: возникла фатальная исключительная ситуация. Программа будет закрыта.»

FIX: Could Not Create the Java Virtual Machine. (Solved)

Java is one of the best development tools for creating games and applications and server-side programs. Games or apps written in Java need the Java Virtual Machine environment to run.

Games or applications developed with Java may crash unexpectedly or fail to open for various reasons, displaying the error «Could Not Create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit».

FIX Could Not Create the Java Virtual Machine

Below you will find several methods to resolve the Java Virtual Machine Launcher error «Could Not Create the Java Virtual Machine», in Windows 10/11 OS.

How to FIX: Could Not Create the Java Virtual Machine in Windows 10/11.*

* Suggestion: Before continuing with the following methods, try the following and see if the problem persists

    1. Install all Windows Updates.
    2. Press CTRL + SHIFT + ESC to open Task Manager and at Processes tab close all instances of Java Virtual Machine (right-click > End Task)

    Method 1. Install the Correct version of JAVA version for Java IDE app*

    * Note: This method only applies to users using a JAVA IDE application for coding.

    If you receive the mentioned error on a JAVA IDE application, you must ensure that the installed version of Java is compatible with the Java version (JRE or JDK) is running on JAVA IDE (Java Integrated Development Environment) application. So, proceed as follows:

    Step 1. Check the JRE/JDK running version of JAVA IDE.

    e.g. In the Eclipse IDE, check which version of the JRE or JDK it is running on by following the steps below:

    1. From main menu, click Help > About Eclipse.
    2. Click on Installation Details and choose the Configuration tab.
    3. In the ‘Eclipse IDE Installation Details’ window, look at the line starting with -vm
    4.
    The value at the line below will show you which JDK or JRE version on which Eclipse is running.

    • e.g.: If the path contains “jre6”, that means that Eclipse is running JRE version 6
    • e.g.:If the path contains «jdk1.8.0_05« means that Eclipse is running JDK version 8.
    Step 2. Check which version of JRE or JDK is installed on Windows.

    1. In the Search box type: cmd (or command prompt). Then select Run as administrator.

    image

    2. To find out the installed JAVA version give the following command and hit Enter:

    • java –version

    view installed java version

    3. If the IDE does not support the Java version on your device, proceed to install the correct version of Java. *

    * Note: In some cases the installed JRE & JDK versions may be different. So, if you JAVA IDE application running on JDK, proceed and check also if the installed JDK matches the running JDK of the JAVA IDE app. To find out the installed JDK version on Windows, give the following command:

    • javac -version

    Method 2. Increase Allocated Memory for JAVA Apps.

    Launching an application that exceeds the maximum memory size of the Java virtual machine could result in the error «Could Not Create the Java Virtual Machine». To work around this problem, go ahead and increase the allocated system memory that JAVA can use as follows:

    1. Click on the Start menu and type in search bar: view advanced system settings. Then click Open.

    image_thumb[8]

    2. In the ‘System Properties’ window, select the Advanced tab and click Environment Variables.

    change java allocated memory

    3. Below the System variables pane, select New.

    image

    4. Set the Variable name as _JAVA_OPTIONS and the Variable value as -Xmx1024M. Then, click OK twice to save the change and close all open windows. *

    * Info: This will adjust the allocated memory for Java to 1GB (1024MB).

    java memory options

    5. Restart your machine to apply the change.
    6. Finally try to open your game or app on Java Virtual Machine. The problem should be gone.

    Method 3. Launch java.exe with Admin rights.

    The Java error also appears when the user does not have the admin rights or permissions to launch certain executables. Configuring Java to always run as an Administrator could fix the problem.

    1. Press the Start menu and type Java in the search box.
    2. Click Open file location.

    image

    3. In the File Explorer window, right-click the Java executable file and select Properties.

    Java properties

    4. At ‘java Properties» window select the Compatibility tab and below the Settings pane, check the box Run this program as an administrator. Then click Apply and OK.

    Java run as Administrator

    5. Finally, start the program that cannot run because of the «Could Not Create the Java Virtual Machine» error and see if the problem persists.

    Method 4. Completely Remove and Reinstall JAVA.

    In some cases, Java may be corrupted or missing components, causing games or applications you are trying to run to close. In this case, follow the instructions below to remove all versions of JAVA versions from your computer and reinstall it.

    1. Download Java Uninstall tool.
    2.
    Run the tool and select to remove all Java versions.

    Java Uninstall Tool

    3. After removal, proceed and delete the Java folder(s) from the following locations on disk (if exist):

    • C:\Program Files\
    • C:\Program Files (x86)\

    4. Restart your computer.

    5. After reboot, visit Java official download page to download and install the latest version of Java.

    download java

    That’s it! Which method worked for you?
    Let me know if this guide has helped you by leaving your comment about your experience. Please like and share this guide to help others.

    Fix: Could Not Create the Java Virtual Machine

    Some users are encountering the Could Not Create The Java Virtual Machine error when trying to launch an application that is using Java. This particular issue is reported to occur with Minecraft and several other applications that are built around Java.

    Could not create the Java Virtual Machine. Error: A fatal exception has occured. Program will exit.

    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 the same error message. Based on their conclusions, there are a couple of scenarios 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 to open an open-source application that is known to cause system instability.
    • Java global maximum heap memory is not high enough – One of the most common causes of why you can encounter this particular error is if you try to start a Java application with a maximum heap memory size larger than the one set as the System Variable.
    • Java executable and/or application require administrative privileges – This might happen with applications that need admin access in order to function properly.

    If you’re currently looking for a way to resolve 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 to 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 in resolving the error for your particular scenario.

    Method 1: Adding the _JAVA_OPTIONS to System Variables

    Most affected users have managed to 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 size for Java.

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

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

    1. Press Windows key + R to open up a Run dialog box. Then, type “sysdm.cpl” and press Enter to open up the System Properties screen.
    2. Inside the System Properties screen, go to the Advanced tab and click on Environment Variables.
    3. In the Environment Variables window, click on New (under System Variables).
    4. Inside the New System Variable window, set the Variable name to _JAVA_OPTIONS and the Variable value to –Xmx512M and click Ok to save the changes.
    5. Close the previously opened windows and restart your machine to enforce the changes.
    6. At the next startup, open the application that was previously showing you the Could Not Create the Java Virtual Machine error and see if is now functioning properly.

    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 PATH\Java\jdk1.6.0_39\bin” to the environment variable as indicated in the above method and see if that works.

    Method 2: Opening java.exe with admin rights

    Several users struggling to resolve the same issue have managed to get the issue resolved after forcing the main Java executable (java.exe) to open with administrative privileges.

    Some users reported that they were able to 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 quick guide through the whole thing:

    Navigate to the location of java.exe

      Open File Explorer and navigate to the location of your java installation. We’ll need to arrive 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 the location of java.exe

    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:

    1. Press Windows key + R to open up the Run prompt and type in “Appwiz.cpl”. Type “appwiz.cpl” into the Run dialog and press Enter
    2. Press “Enter” and the Programs and Features screen will open up.
    3. At the Programs and Features screen, scroll through the installed application list until you find Java. Checking the Programs and features screen
    4. Right-click on it and select “Uninstall” to remove it completely from the system
    5. First, delete the primary Java installation and later you should also remove all other Java installations such as updates and other versions.
    6. After uninstalling all installation, restart your computer.
    7. After booting up, visit this link and download the latest version of JRE.
    8. Check to see if the issue persists.
    9. If the error still persists, download and install the latest version of JDK from here.
      Note: If you are already using JDK, try changing its versions or uninstalling the JRE that has been installed along with it.
    10. Verify if the issue still exists.

    Method 4: Fixing Errors With Code

    There are different reasons behind this error and 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 a single one “-” in their code. For example:
      Change the code
      “sony@sony-VPCEH25EN:

    Fixes to the “Could Not Create the Java Virtual Machine” Error [MiniTool Tips]

    You may encounter the “could not create the Java virtual machine” error when you try to start an application that uses Java. This post from MiniTool tells you the reasons for the annoying issue. Besides, you can find some feasible methods to fix it in this post.

    Could Not Create the Java Virtual Machine

    It’s annoying to encounter the “could not create the Java virtual machine” issue. There are some main reasons for the error: could not create the Java virtual machine.

    1. Wrong parameters or options call Java.

    2. Java global maximum heap memory is not high enough.

    3. Java executable files and/or applications require administrative permissions.

    Now, let’s see how to fix the annoying issue.

    How to Fix Could Not Create the Java Virtual Machine

    Set up a New System Variable for Java

    First, you can try to set up a new system variable for Java to fix the “could not create the Java virtual machine” error. Here is how to do that:

    Step 1: Press the Windows + R keys at the same time to open the Run dialogue box. Type sysdm.cpl and press Enter to open the System Properties screen.

    Step 2: Navigate to the Advanced tab and click the Environment Variables. option.

    click the Environment Variables. option

    Step 3: Under the System Variables part, you need to click New. .

    Step 4: Set the Variable name to _JAVA_OPTIONS and the Variable value to –Xmx512M and click OK to save the changes.

    After that, restart your PC to check if the “could not create the Java virtual machine” error has gone. If not, try the next solution.

    Open Java.exe with Admin Rights

    Then, you can also try to open Java.exe with admin rights to fix the “could not create Java virtual machine” issue. Follow the steps below to fix that:

    Step 1: Type Java in the Search box. Then right-click it and select Open file location to open the Java’s folder in File Explorer.

    Step 2: Now you can right-click the java.exe and select Properties.

    Step 3: Select the Compatibility tab. Select the Run this program as an administrator option.

    Step 4: Select the Apply option and click OK to close the window.

    Reinstall Java

    The last method for you to fix the “could not create the Java virtual machine” error is to reinstall Java. You can follow the instructions below.

    Step 1: Press Win + S to open Search. Then search for Control Panel and launch it.

    Step 2: In Control Panel, select View by: Category on the upper right corner. Then click Uninstall a program.

    click Uninstall a program

    Step 3: Select each Java-related program from the list and then click Uninstall. Follow the on-screen instructions to finish the process.

    Step 4: When all the Java programs are uninstalled, restart your computer. Visit the Java official website to reinstall the Java environment.

    Then you can check if “could not create the Java virtual machine” error is removed.

    Final Words

    After reading this post, you should know how to get rid of the “could not create the Java virtual machine” error. If you have any confusion about the methods, leave a comment below and we’ll reply to you as soon.

    • Facebook
    • Twitter
    • Linkedin
    • Reddit

    About The Author

    Daisy graduated with a major in English and then joined MiniTool as an editor. She specializes in writing articles about backing up data & systems, cloning disks, and syncing files, etc. She is also good at writing articles about computer knowledge and computer issues. In daily life, she likes running and going to the amusement park with friends to play some exciting items.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *