After the M2_HOME environment variable is changed, mVN-V is executed on the terminal and the following error occurs:
Exception in thread “main” java.lang.NoClassDefFoundError: org/codehaus/plexus/classworlds/launcher/Launcher
Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.classworlds.launcher.Launcher
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org. Codehaus. Breadth. Classworlds. The launcher. The launcher. The Program will exit.
If you are a Linux system, you may be in the/etc/profile, ~ /. Following/~/bashrc file configured in the environment variable M2_HOME, when M2_HOME value change, even if you execute the source/etc/profile operation, also can appear as wrong, then you will need to open a terminal or log back in to, if you are a Windows system, to open a CMD window, generally is ok, So the root cause of the appeal error is that mVN-V was executed on the same terminal when switching between two versions of Maven without opening a new terminal or logging in again.
Exception in thread “main” java.lang.NoClassDefFoundError: org/codehaus/plexus/classworlds/launcher/Launcher
Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.classworlds.launcher.Launcher
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org. Codehaus. Breadth. Classworlds. The launcher. The launcher. The Program will exit.
If you are a Linux system, you may be in the/etc/profile, ~ /. Following/~/bashrc file configured in the environment variable M2_HOME, when M2_HOME value change, even if you execute the source/etc/profile operation, also can appear as wrong, then you will need to open a terminal or log back in to, if you are a Windows system, to open a CMD window, generally is ok, So the root cause of the appeal error is that mVN-V was executed on the same terminal when switching between two versions of Maven without opening a new terminal or logging in again.
Read More:
- Unable to find or load master class org.codehaus.groovy.grails.cli.support
- Error: Could not find or load main class org.apache.hadoop.hbase.util.HBaseConfTool
- The Java command could not find or load the main class
- Tomcat9 Error: Could not find or load main class org.apache.catalina.startup.Bootstrap
- Could not find or load main class
- Error: could not find or load main class
- Error: Could not find or load main class ***
- Java error: unable to find or load the main class
- Idea error: unable to find or load the main class
- Error: the main class usertest could not be found or loaded
- Idea startup project: main class not found or cannot be loaded
- The main class could not be found or loaded when springboot started
- The main class com.hp.springbootapplication cannot be found or loaded
- Failed to load Main-Class manifest attribute from when the jar file is running
- Hive execution task report cannot find main class error
- Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0
- python: This application failed to stat could not find or load the Qt platform plugin “windows”
- When jar file is running: Failed to load Main-Class manifest attribute from ……Solution
- Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign
- [Solved] IntelliJ IDEA Compile Groovy Error: GroovyRuntimeException: This script or class could not be run.