解决IDEA控制台junit不能用Scanner输入

**问题:**IDEA在Junit测试中使用了Scanner,但是控制台一直转圈,无法输入

在这里插入图片描述

解决:在配置文件idea.exe.vmoptions、idea64.exe.vmoptions**中添加,

-Deditable.java.test.console=true

好像一个是32位的,一个是64位的,(不确定的话就都加上吧。。。)
在这里插入图片描述
https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000556544-Why-can-t-I-input-anything-from-console-when-i-run-unit-test-with-JUNIT

posted @ 2020-03-23 18:46  榆阳123  阅读(99)  评论(0)    收藏  举报