To install Java on Windows using the command prompt, you can follow these steps:
Download the Java 11 JDK for Windows from the Oracle website.
Extract the downloaded ZIP file to the desired installation location. For example:
md C:\Java tar -xvf openjdk-11.0.10_windows-x64_bin.zip -C C:\Java
JAVA_HOME
environment variable to the path of the Java 11 installation. For example:setx JAVA_HOME "C:\Java\jdk-11.0.10"
bin
directory of the Java 11 installation to the PATH
environment variable. For example:setx PATH "%PATH%;%JAVA_HOME%\bin"
java -version
Note that these steps will install the Oracle version of Java 11. If you prefer to install the OpenJDK version of Java 11, you can download it from the OpenJDK website and extract the ZIP file to the desired installation location.
For more information on installing Java on Windows, you can refer to the Oracle documentation or the OpenJDK documentation.