When running mvn -v
or mvn -version
I receive the following error:
Error: -classpath requires class path specification
However, I have followed the instruction as defined on both: https://www.oracle.com/uk/java/technologies/downloads/#jdk21-windows and https://maven.apache.org/download.cgi
What is missing or misconfigured that could be causing this error?
I am using:
Maven 3.9.5
Java Version: 21
Directory Locations:
Maven is located at:
C:\Maven
Java JDK is located at:
C:\Program Files\Java
Environment Variables:
User Variables:
JAVA_HOME
: C:\Program Files\Java\jdk-21
M2_HOME
: C:\Maven\apache-maven-3.9.5-src\apache-maven-3.9.5\apache-maven\src
M2
: %M2_HOME%\bin
MAVEN_HOME
: C:\Maven\apache-maven-3.9.5-src\apache-maven-3.9.5\apache-maven\src
Path Variable: // This reflects my various attempts to get this to work.
%JAVA_HOME%\bin
C:\Program Files\Java\jdk-21\bin
C:\Maven\apache-maven-3.9.5-src\apache-maven-3.9.5\
%M2%
C:\Maven\apache-maven-3.9.5-src\apache-maven-3.9.5\apache-maven\src\bin
%M2_HOME%
C:\Program Files\Java\jdk-21
Lastly, when running java -version
, the following is returned:
java version "21" 2023-09-19 LTS
Java(TM) SE Runtime Environment (build 21+35-LTS-2513)
Java HotSpot(TM) 64-Bit Server VM (build 21+35-LTS-2513, mixed mode, sharing)
You are trying with source. Download the binaries from https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.zip