Search code examples
javaclassclasspathclassnotfoundexception

How do I resolve ClassNotFoundException?


I am trying to run a Java application, but getting this error:

java.lang.ClassNotFoundException:

After the colon comes the location of the class that is missing. However, I know that that location does not exist since the class is located elsewhere. How can I update the path of that class? Does it have something to do with the class path?


Solution

  • Your classpath is broken (which is a very common problem in the Java world).

    Depending on how you start your application, you need to revise the argument to -cp, your Class-Path entry in MANIFEST.MF or your disk layout.