错误描述
在idea中运行springboot程序时,有时会遇到以下错误:
Command line is too long. Shorten command line for VpclubApplication or also for Spring Boot default configuration.
如图所示:
错误原因
springboot项目启动命令过长
解决方案
方案一:修改工作空间配置
- 在项目的
.idea
目录下找到workspace.xml
文件,打开编辑 - 找到标签
<component name="PropertiesComponent">
- 在上述标签下添加一行
<property name="dynamic.classpath" value="true" />
对于新版本的idea,这里是以key-value的形式配置的:"dynamic.classpath": "true",
方案二:修改启动项配置
- 打开项目的启动项配置
- 打开Enviroment 标签
- 将Shorten command line选项修改为
JAR manifest
或classpath file