bug记录:

IDEA报错:Error running ‘TestMain’: Command line is too long. Shorten command line for TestMain or also for Application default configuration.

IDEA报错:Command line is too long.
大多数操作系统都有命令行长度限制,上图在控制台打印了10W次的字符串,程序无法启动。

解决方法: 修改idea运行参数。
打开IDEA的Run->Edit Configurations选项,修改为

  1. none:这是默认选项,idea不会缩短命令行。如果命令行超出了OS限制,这个想法将无法运行您的应用程序,但是工具提示将建议配置缩短器。
  2. JAR manifest:idea 通过临时的classpath.jar传递长的类路径。原始类路径在MANIFEST.MF中定义为classpath.jar中的类路径属性。
  3. classpath file:idea 将一个长类路径写入文本文件中。 建议使用第三种
    IDEA报错:Command line is too long.

相关文章:

  • 2021-07-30
  • 2021-11-16
  • 2021-08-06
  • 2021-05-19
  • 2021-04-08
  • 2021-12-14
  • 2021-05-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2021-08-02
  • 2021-05-03
  • 2022-12-23
相关资源
相似解决方案