Hello I am just download maven binaries and after set all the environment variable, I am running mvn -version
cmd and get this exception.
Exception in thread "main" java.lang.IllegalAccessError: tried to access field org.codehaus.plexus.util.Os.OS_NAME from class org.apache.maven.cli.CLIReportingUtils at org.apache.maven.cli.CLIReportingUtils.showVersion(CLIReportingUtils.java:71) at org.apache.maven.cli.MavenCli.cli(MavenCli.java:423) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:277) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Download Maven at here.
Unzip, for example: C:\tools\
Press Windows+R, type systempropertiesadvanced
, press Enter
Set environment: MAVEN_HOME
= C:\tools
Add to PATH
environment variable: ;%MAVEN_HOME%\bin
Close all
Call cmd
, run command:
mvn -v
java -version
to make sure Java is installedC:\Program Files\Java
)if we open that new folder we should have something like
Variable Name: M2_HOME
VARIABLE VALUE: C:\Program Files\Java\apache-maven-3.6.3
C:\Program Files\Java\apache-maven-3.6.3
into the PATH variablemvn --version
.That's it, you have now Maven installed in Windows 10.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With