前几天跑一个Spring Boot项目,由于依赖实在是太多,刚启动过,IDEA启动就报下面错误
Error running 'CloudBasicApplication'
Error running CloudBasicApplication. Command line is too long.
Shorten the command line via JAR manifest or via a classpath file and rerun.
这个错误是 IntelliJ IDEA 中常见的问题,提示 “Command line is too long”,意思是启动应用时传递给 JVM 的命令行参数(尤其是 classpath)太长,超出了操作系统的限制。
解决方法
IntelliJ IDEA 提供了多种缩短命令行的方式。直接按照以下步骤操作即可解决:
打开IDEA运行配置(Run/Debug Configurations):
点击顶部工具栏运行配置下拉菜单 → Edit Configurations...
在打开的窗口中,找到你的 CloudBasicApplication 配置。
找到 “Shorten command line” 选项(通常在 Environment 区域下方)。
将其设置为:
“JAR manifest” 或
“classpath file”(推荐后者,兼容性更好)
点击 OK,重新运行项目。
💡 “classpath file” 会把 classpath 写入一个临时文件,然后通过
@file的方式传给 JVM,从而避免命令行过长。
9101

被折叠的 条评论
为什么被折叠?



