方法:
按快捷鍵 alt+ctrl+s 打開 settings 對話框, 搜索‘ Compiler’ 勾選 make project automatically. 也可以像Eclipse 那樣,ctrl+s 後可以出發重新編譯, 具體操作:在settings 中 找到 keymap 重新設置 make project 由 ctrl+s 快捷鍵觸發!
詳情:
http://stackoverflow.com/questions/12744303/intellij-idea-java-classes-not-auto-compiling-on-save
對intellij 做個補充:
編譯時,該工具提供2種編譯方式:javac 、 eclipse , 明顯的區別:eclipse 這種編譯方式比javac 有更強的容錯機制,用Eclipse 方式編譯時,能夠運行不能成功編譯的代碼。
原文:
The biggest difference between the Eclipse and javac compilers is that the Eclipse compiler is more tolerant to errors, and sometimes lets you run code that doesn't compile.