IDEA报错:Error running $classname: Command line is too long. Shorten command line for $classname.

报错信息如下:

IDEA报错:Error running $classname: Command line is too long. Shorten command line for $classname.

之所以出现这个原因是一般是因为打印的环境变量太长了,超过了限制,可以尝试以下方案:

方法一:选中上图中的蓝色字,跳转到下图。

选择j如图jar manifest(每个报错的类都需要注意设置)

IDEA报错:Error running $classname: Command line is too long. Shorten command line for $classname.

方法二:项目的.idea/workspace.xml有这个选项,可以修改默认值,这样就不用每次更改

IDEA报错:Error running $classname: Command line is too long. Shorten command line for $classname.