It is also possible that a jar you depend on in turn depends on a jar that you don’t have anywhere. This error is a clear sign that you are missing a jar file on your runtime classpath that you have on your compile-time classpath.
INTELLIJ JAR RUNTIME TO COMPILE TIME CODE
The JVM throws NoClasDefFoundError, which means that a class is missing, which was present when the code was compiled. you compile the code with a given library on the compile-time classpath, but forget to add it to the runtime classpath.Well, not necessarily all of them, and not necessarily only them. But it doesn’t – you need the same jars that you used to compile your application to be present on your runtime classpath as well. Many people assume that if they successfully compiled the application with a given jar file present, it means that the application will run fine. Read the short description of each scope. Maven defines dependency scopes that are really useful for explaining the differences between the different types of classpaths. Tests do not run inside your application server/servlet container, so their classpath is a bit different test classpath – this is also a sort of runtime classpath, but it is used when you run tests.In the case of web apps this is your /lib folder, plus any other jars provided by the application server/servlet container That’s the classpath passed to the “java” executable.
Contains the classes that are used when your application is running. In other words, this is the classpath passed to “javac” (though you may be using another compiler).
Contains the classes that you’ve added in your IDE (assuming you use an IDE) in order to compile your code. But there are two, or actually three distinct classpaths: So, what is a classpath? A set of all the classes (and jars with classes) that are required by your application. This should really be a simple distinction, but I’ve been answering a slew of similar questions on Stackoverflow, and often people misunderstand the matter.