editor does not contain a main type

eclipse使用时,特别是源代码导入时,很容易出现这个问题:editor does not contain a main type

解决方法:
make sure your class stands in (project name)/src/(package default)

确保你的代码在src目录下面.

我导入thinking in java 4th源代码时,就出现此问题.后来把源代码拖到src目录下,就好了!

 

 

你可能感兴趣的:(java,eclipse,Class)