Intellij IDEA运行报 Command line is too long 解法

有时候我们运行程序的时候会出现如下错误

Intellij IDEA运行报 Command line is too long 解法

 

该错误解决方法:

打开 Run/Debug Configurations,Configuration Tab页下有个 Shorten command line 选项,将该选项改为 JAR manifest 或 classpath file·。

如下图:

 

Intellij IDEA运行报 Command line is too long 解法

这三个选项含义如下:

none:默认选项,idea不会缩短命令行。如果命令行超出了OS限制,这个想法将无法运行您的应用程序,但是工具提示将建议配置缩短器。

JAR manifest:idea 通过临时的classpath.jar传递长的类路径。原始类路径在MANIFEST.MF中定义为classpath.jar中的类路径属性。

classpath file:idea 将一个长类路径写入文本文件中。

 

【官方文档】:https://blog.jetbrains.com/idea/2017/10/intellij-idea-2017-3-eap-configurable-command-line-shortener-and-more/