解决项目启动报错
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