Causes and solutions:
1. The JDK environment does not correspond to the operating system
The downloaded JDK environment must Corresponds to your own operating system. Download the 32-bit Windows JDK environment for 32-bit operating systems, and download the 64-bit Windows JDK environment for 64-bit operating systems.
2. The installation directory of the JDK environment is wrong.
When installing the JDK environment, there will be two path selections, which can be left unchanged by default. If the path is customized, the path of the previous JDK and the path of the subsequent one will be selected. The path of a JRE cannot be in the same subdirectory because the JDK environment contains another JRE file to avoid conflicts. The installation path of the JRE cannot be selected in the JDK file path.
Recommended learning: Java video tutorial
The above is the detailed content of Why can't java be installed? How to solve?. For more information, please follow other related articles on the PHP Chinese website!