Exception in thread "main" java.lang.NoClassDefFoundError: DList(wrong name: list/DList)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
atjava.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
atsun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
atsun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
My file directory:
The source code of the Simple.java:
And when I execute Simple.class, without any errors of compilation,I get this error message:
Does anyone know how to solve this? | |||||
|
You're executing the command in the wrong folder, with the wrongclassname. You need to use the fully qualified name (FQN) whenrunning a Java class. And of course, you have to be in the rightdirectory. In your example, the FQN of your class ism2mcom.web.Simple (combination ofthe As far as deducing the right directory, your classes are stored ina hierarchical folder structure, which basically startsin So to correctly execute your program,from
|