Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program wi

When installing java (jdk or jre) in win10, the environment error is reported: Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program wil


环境报错:
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program wil

1. Download the package and install java

Download the jdk package from the official website.
Directly
download  the installation at the end of .exe
. In the next step, install-end is selected by default .
Run windows+r and enter cmd
to execute java --version
Error: Could not create the Java Virtual Machine
Error: A fatal exception has occurred. Program wil

2. Solve error reports

1. Right-click My Computer****- Properties - Advanced System Settings-Environment Variables
Insert image description here

Insert image description here

2. In "User Variables" " New ", enter the variable name: JAVA_HOME
and variable value: C:\Program Files\Java\jdk-11.0.8  (your own JDK installation path)

Insert image description here

3. Find the "Path" variable in "User Variables" and click "Edit". **

Insert image description here

,4. Click New, create two new variables, and then confirm.
Variable value:
%JAVA_HOME%\bin
%JAVA_HOME%\jre\bin

Insert image description here

5.  Run "windows+r" on the keyboard and enter cmd

Insert image description here
Execute  java --version

Insert image description here
Then the installation of the java environment is completed.

Guess you like

Origin blog.csdn.net/unbelievevc/article/details/132574883