springboot项目启动类报错Command line is too long解决方法

错误信息

Error running BossApplication. Command line is too long. Shorten the command line via JAR manifest or via a classpath file and rerun.

一、问题原因分析

​ 该报错主要是由于文件名过长,导致启动命令超出Windows系统的单个命令行长度限制(Windows命令行最大支持8191个字符)。

二、解决方案

解决方案1

<!--在项目下的.idea文件夹下的workspace.xml文件中-->
<component name="PropertiesComponent"> , 在标签里加一行
 <property name="dynamic.classpath" value="true" />

解决方案2

原文链接:如何解决Error running ‘XXXApplication’: Command line is too long.Shorten command line for

打开运行配置

在IDEA顶部工具栏中找到运行配置下拉菜单

点击右侧的"Edit Configurations..."选项

img

修改命令行设置

在配置窗口中找到并点击"Modify options"按钮

img

从展开的下拉列表中选择"Shorten command line"选项

img

选择缩短方式

在新增的配置项中,选择"JAR manifest"模式

img

点击"Apply"保存配置修改

posted @ 2021-12-16 17:54  进击的小蔡鸟  阅读(465)  评论(0)    收藏  举报