I have a standalone java project. I have performed a maven clean install. I now go into the target\classes 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