【IntellJ IDEA】idea启动测试类报错Error running 'Test1.test': Command line is too long. Shorten command line for Test1.test or also for JUnit default configuration.

idea启动测试类报错

Error running 'Test1.test': Command line is too long. Shorten command line for Test1.test or also for JUnit default configuration.

注意:

最简单的方法,就是你重新创建一个新的测试类,在里面重新写一遍测试方法,代码都可以粘贴过去。

解决方法:

1.打开本项目的.idea文件夹,找到文件夹中的workspace.xml文件

2.搜索 

PropertiesComponent

3.在这个父级结构中添加

<property name="dynamic.classpath" value="true" />

 4.保存以后 右键测试方法,查看效果,如果依旧有 问题,则设置

5.效果如下

原文地址:https://www.cnblogs.com/sxdcgaq8080/p/9025201.html