1

Maven Installed, unable to edit system variables I have Maven installed, and it was working fine yesterday, however now it is displaying the infamous (Maven error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher)

Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher

error...

In other solutions, it seems that the system variable needs to be edited from M2_HOME to M3_HOME. Yet, I am unable to edit my system environment variables (also pictured).

Any suggestions for how I can get past this and be able to perform a clean maven installation?

marcz2007
  • 167
  • 1
  • 1
  • 11
  • duplicate of https://stackoverflow.com/questions/33133809/maven-error-could-not-find-or-load-main-class-org-codehaus-plexus-classworlds/33190546#33190546 ? – Robert Scholte Oct 21 '21 at 12:01
  • Hi Robert, I mentioned this question in the post - whilst it is similar, I was hoping for an answer which doesn't involve changing the system environment variables since I do not have access to them – marcz2007 Oct 21 '21 at 12:48
  • There's no such thing as `M3_HOME`. Just like the `.m2` folder representing your local repository is also used by Maven 3. Just wondering, who or what set the M2_HOME? – Robert Scholte Oct 21 '21 at 13:22
  • Answering my own question: chocolatey did that, it is something that should be removed. I followed the same steps you did, and it works for me, which makes we wonder: do you have another Maven on your path? – Robert Scholte Oct 21 '21 at 13:29
  • So I just uninstalled chocolatey by running command prompt as admin, then reinstalled it. All seems to be working now and I didnt have to touch the system environment variables. So I think thats the answer - thank you for your help Robert :) – marcz2007 Oct 21 '21 at 13:33

1 Answers1

0

Solution: I just uninstalled chocolatey by running command prompt as an administrator, then reinstalled it. For some reason this worked - no idea as to why but that was the solution to the error without having to change system variables.

marcz2007
  • 167
  • 1
  • 1
  • 11