https://maven.apache.org/guides/getting-started/windows-prerequisites.html says ...
You need to install the Java SDK (e.g. from Oracle's download site), and you should install it to a pathname without spaces, such as c:\j2se1.6.
... which is inconvenient if it's already installed, because that's not the default directory.
https://maven.apache.org/install.html says ...
- Check environment variable value e.g.
... which contradicts the above.
One or other of these should be changed.
See also https://stackoverflow.com/questions/18724226/why-shouldnt-i-put-spaces-in-my-maven-path-in-windows which is from 2010 and could be updated when you decide what the right answer is (i.e. whether it's necessary to install into a path without space).