IDEA 解决 Command line is too long. Shorten command line for App or also for Spring Boot default configuration.
1.报错详细信息:
Error running 'App':
Command line is too long. Shorten command line for App or also for Spring Boot default configuration.
2.问题分析:
错误原因:
命令行太长的原因导致整个应用和spring boot无法成功启动。
错误分析:
IDEA的底层是通过命令行或文件的方式将classpath传递到Java的JVM上,而大多数的操作系统都会有命令行的最大长度限制,超过这个限定值时就会导致IDEA无法启动当前的程序。
错误解决:
当命令行长度大于32768个字符时,将IDEA切换到动态类路径。长类路径被写入文件,然后由应用程序启动器读取并通过系统类加载器加载
3.如何解决?
该配置的作用是开启IDEA的动态类路径,将太长的类路径写入文件中,然后由应用程序启动器读取并通过系统类加载器加载。
参考博文:
https://blog.csdn.net/weixin_45751409/article/details/111560986?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522162979641916780357214972%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=162979641916780357214972&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_ecpm_v1~rank_v29_ecpm-1-111560986.first_rank_v2_pc_rank_v29&utm_term=shorten+command+line+for+app+or+also&spm=1018.2226.3001.4187