Install open JDK 18 and Maven in Windows 10.
Just download open JDK, latest version.
https://jdk.java.net/18/
Unzip it and create a folder called Java in C:\Program Files, and move the extracted files in to ,C:\Program Files\Java
Then set system variables as below.
path
C:\Program Files\Java\jdk-18.0.2\bin
JAVA_HOME
C:\Program Files\Java\jdk-18.0.2
CLASSPATH
C:\Program Files\Java\jdk-18.0.2\bin
Below commands should work.
java -version
javac -version
jshell
Then download maven, binaries apache-maven-3.8.6-bin.zip from https://maven.apache.org/download.cgi
Extract the file and create folder without spaces in C: drive. Example, C:\Maven and move the extracted files.
Go to system variables and add
MAVEN_HOME
C:\Maven\apache-maven-3.8.6
After that in path variable , create new and add this .
%MAVEN_HOME%\bin
Open a command line and type
mvn -version