我得到java.lang.ClassNotFoundException
:
Exception in thread "main" java.lang.NoClassDefFoundError: Consts/SortOfPages
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: Consts.SortOfPages
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more
这是SortOfPages类:
package Consts;
public enum SortOfPages {
POPUP("New - "),
SILENT("Silent - ");
public String description;
private SortOfPages(String description) {
this.description = description;
}
public String getDescription() {
return description;
}
}
导入主类:
import Consts.SortOfPages;
但是当我搜索Const / SortOfPages时,我发现它,并且它存在。
我尝试清理,再次构建 - 同样。
我该如何解决?