I have a standalone java project. I have performed a maven clean install. I now go into the targetclasses folder via command prompt and set all the required files in classpath. Now I execute the main class. The result is being displayed.
Now I move back to target folder via command prompt and try to execute the jar file (jar file has a manifest file where the main class is defined).
Java -cp %CLASSPATH% -jar Destination-01.19-SNAPSHOT.jar
Now I get the below exception. I have also removed the classpath attribute from the statement above but still get the same exception.The required class is set in classpath variable which is the reason why I was able to run the main class without using the -jar attribute.
Exception in thread "Main Thread" java.lang.NoClassDefFoundError: org/apache/co
mons/logging/LogFactory
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…