最近在使用idea执行项目的单元测试的时候,会出现如下报错 : Command line is too long. Shorten command line for {className} or also for JUnit defaultconfiguration.

如下图所示:
在这里插入图片描述

解决方法一 : 修改启动配置

idea点击Edit Configurations --> Shorten command line下拉选择JAR manifest
在这里插入图片描述

解决方法二 :

在该项目下找到如下文件: /.idea/workspace.xml
在文件中找到

<component name="PropertiesComponent">

</component>

然后在其中添加 :

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

这样问题就解决了。
在这里插入图片描述

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐