java.lang.NoClassDefFoundError Main (Wrong Name : com/leslie/quiz/Main)

橙三吉。 提交于 2019-12-02 09:22:22

Since your Main class is in the com.leslie.quiz package, you should cd to the parent directory of the compiled output and run the command:

java com.leslie.quiz.Main

Note that the default binary output directory in Eclipse is a project's bin directory. Although it's hidden from the Package Explorer view in Eclipse, it will still exist on the file system. You should be able to see it from the Navigator view in Eclipse.

The contents of bin will look something like this:

bin/
  com/
    leslie/
      quiz/
        Core.class
        Main.class
        Start.class

In this case, cd to bin and run the java command.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!