java.lang.NoClassDefFoundError: org/codehaus/plexus/classworlds/launcher/Launcher when running bash file to build the project java.lang.NoClassDefFoundError: org/codehaus/plexus/classworlds/launcher/Launcher when running bash file to build the project linux linux

java.lang.NoClassDefFoundError: org/codehaus/plexus/classworlds/launcher/Launcher when running bash file to build the project


Couple of possibilities...

  • One, as posted here, you have both M2_REPO and M3_REPO variables defined.
  • Or you are facing this issue related to maven3 and M2_HOME
  • The other is that somehow the JRE is getting used instead of JDK when run from the batch file!


I had this issue when my M2_HOME environment variable points to an incorrect location.

Try to:

$ cd $M2_HOME