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

2022-12-07,,,,

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.效果如下

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

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

下载本文的Word格式文档,以方便收藏与打印。