编程环境
IDE使用
eclipse的使用
快捷键
- ctrl+o: 导入包。
错误解决
现象:使用eclipse运行带有main函数的Java文件时,出现editor does not contain a main type的错误框
原因:原来这个class所在包没有被添加到build path中。
解决方法:在左侧的package explorer中右击这个class所在包的上一级目录–build path–use as source folder。这样就解决问题了。重新打开class,再run一下,ok了。
快捷键以及相关知识
navigator:source以及resource是以文件夹为单位形式整合显示的。如果是学习阶段的话,建议使用该模式。
package explorer:source是以包为单位整合显示的。ctrl+o :导入包
- alt+<- : 返回上一位置