Thank you for your help. No that's not the problem; I have set up JAVA_HOME and MAVEN_HOME (M2_HOME is no longer recommended) and I set the bin directories in PATH. It recognizes when I type mvn, so the variables are correct; also the error message means that it is using
Java.