报错:Command line is too long. Shorten the command line and rerun.

启动 D:\xxx-boot\sender\src\main\java\org\springblade\XXXApplication.java 报错

image

原因:

报错:Command line is too long. Shorten the command line and rerun.

含义:启动命令行参数过长,是 IDEA 经典问题;项目依赖较多时,classpath 字符串超出系统限制,SpringBoot 项目非常常见。

启动类:XXXApplication

 

解决办法:

选中XXXApplication.java类,右键 More Tun/debug——>Modify Run Configuration...

  1. 点击界面右上角 Modify options 按钮
  2. 在展开的下拉菜单里,找到并点击 Shorten command line,勾选启用这个选项
  3. 此时界面会多出一个 Shorten command line 下拉选择框,点开选择:
    ✅ JAR manifest
你的 JDK 版本是 18,也可以选择 @argfile (Java 9+),优先推荐 JAR manifest
  1. 点击 ApplyOK,保存配置
  2. 重新启动 XXXApplicationCommand line is too long 报错即可解决
posted @ 2026-07-14 10:22  贩卖长江水  阅读(11)  评论(0)    收藏  举报