1.打开idea------找到help-------点击Edit Custom VM Options 2.在最后添加:-Deditable.java.test.console=true 3.保存,重新打开idea。