Error running ‘类名’: Command line is too long. Shorten command line for 类名 or also for Application...

1、问题
Error running '类名': Command line is too long. Shorten command line for 类名 or also for Application default configuration.

 

2、原因

 IDEA启动项目的时候是使用命令启动的。启动命令会输出在日志控制台的第一行,双击可展开显示全部命令。这个命令特别长,在windows系统中当超过32767个字符,就会报错!

 

3、解决方法

(1)方法一

在项目的.idea/workspace.xml文件中,找到 <component name="PropertiesComponent">,添加一行 <property name="dynamic.classpath" value="true" />


 

(2)方法二

在IDEA中找到 Run-> Edit Configurations打开

 修改 Shorten command line 的内容配置为 JAR :

 注意:这种方法只能在本类有效

posted @ 2021-03-16 11:09  Vency_L  阅读(219)  评论(0编辑  收藏  举报