解决Error running IandunCustservApplication. Command line is too long. Shorten the command line

解决项目启动报错

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

在这里插入图片描述

打开启动配置

在这里插入图片描述

修改配置选项

在这里插入图片描述

勾选shorten command lines

在这里插入图片描述

选择JAR maniftest

三种选项的意思:

  • none:不会缩短classptah。如果命令行参数长度超过了操作系统的限制,那么idea就不会运行应用,然后会显示一个提示语来建议你缩短命令行长度

  • JAR manifest:idea会把classpath写入临时生成的classpath.jar中的manifest文件中

  • classpath file: idea将把一个长classpath写入一个文本文件

在这里插入图片描述

Shorten command line总结

  • none(默认):不缩短JVM参数,直接把所有classpath作为JVM参数穿进去
  • JAR manifest:把所有classpath写入到临时的claapath.jar包中的manifest文件中,在manifest文件的Class-Path属性中指定所有的classpath。然后JVM参数中指定classpath参数为claapath.jar所在的绝对路径
  • classpath file:把所有的classpath写入到临时的文本文件中,然后把classpath设置到idea自定义的URLClassLoader中,然后使用自定义的URLClassLoader加载程序入口,反射调用main方法。main方法所在的类的ClassLoader就是idea自定义的URLClassLoader

具体深入分析请查看:Shorten command line

  • 5
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值