文章目录

  • 一、背景
  • 二、原因
  • 三、解决
  • 四、总结

一、背景

在Debug启用@test方法或者IDEA 启动项目出现Shorten the command line via JAR manifest or via a classpath file and rerun。

二、原因

  1. 问题分析:
    命令行太长

  2. 错误原因:
    看报错的那段英文,可知是命令行太长的原因导致SpringBoot和整个应用无法成功启动,那为什么会报这样一个错误呢?

  3. 错误分析:
    其实IDEA底层是通过命令行或者文件的方式将classpath传递到Java的JVM虚拟机上的,而大多数的操作系统都会有命令行的最大长度限制,超过这个限定值时就会导致IDEA无法启动当前程序。

  4. 错误解决:
    当命令行长度大于32768个字符时,将IDEA切换到动态类路径。长类路径被写入文件,然后由应用程序启动器读取并通过系统类加载器加载。

三、解决

  • 方案一:修改文件.idea/workspace.xml
    1)找到项目下的.idea/workspace.xml
    2)打开文件,找到标签:PropertiesComponent
    3)添加一行属性:
<component name="PropertiesComponent">其它属性代码不要修改,只添加下面一行属性代码<property name="dynamic.classpath" value="true" />
</component>


  • 方案二:修改参数Shorten command line

    • 点击菜单栏Run——>Edit Configurations
    • 点击Modify options——>Shorten command line,显示出Shortn command line参数(默认值为noe)
    • 点击Shorten command line下拉框——>改为JAR manifest 或 classpath file


四、总结

修改完重新debug即可,亲测有效。希望对你有帮助。如有问题随时评论区留言交流!

【idea】IDEA 出现问题:Error running xxx Command line is too long. Shorten command line 解决方案相关推荐

  1. Error running xxx. Command line is too long. Shorten the command line via JAR manifest or via a clas

    Error running xxx. Command line is too long. Shorten the command line via JAR manifest or via a clas ...

  2. 启动springboot项目 Error running ‘xxx‘

    1.java运行环境 OS:windows10 jdk:1.8 idea:2018 2.启动springboot项目 报Error running 'xxx' Error running 'xxx' ...

  3. Error running 'XXX': Cannot start process, the working directory 'F:\JavaSe\JavaSe' does not exis

    IDEA 运行项目错误:Error running 'XXX': Cannot start process, the working directory 'F:\JavaSe\JavaSe' does ...

  4. Error running Command line is too long. Shorten command line for

    Error running 'xxxxxxxxApplication': Command line is too long. Shorten command line for xxxxxxx? 使用网 ...

  5. Error running ‘类名’: Command line is too long. Shorten command line for 类名 or also for Application...

    1.问题 Error running '类名': Command line is too long. Shorten command line for 类名 or also for Applicati ...

  6. 解决:Command line is too long. Shorten command line for xxx or also for Application default configurat

    解决:Error running 'xxx': Command line is too long. Shorten command line for xxx or also for Applicati ...

  7. IDEA启动main函数时,Command line is too long Shorten command line for XXX or also问题解决

    巧了,最近起了一个挺长的类名,启动main函数的时候,idea返回了一个Command line is too long Shorten command line的报错,请教研究之后,解决方法如下 方 ...

  8. command line is too long. shorten command line for xxx的解决方法

    command line is too long. shorten command line for xxx的解决方法 问题: IDEA启动时报: command line is too longxx ...

  9. Command line is too long. Shorten command line for Application---微服务升级_SpringCloud Alibaba工作笔记0067

    今天打开idea项目,启动的时候,无法启动报错: 15:19    Error running 'Application': Command line is too long. Shorten com ...

  10. Command line is too long. Shorten command line for PictureApplication or also for Spring Boot defaul

    一,报错信息 Error running 'PictureApplication': Command line is too long. Shorten command line for Pictur ...

最新文章

  1. Kafka技术架构那些事儿
  2. [置顶] 归并排序,逆序数
  3. Java向MySQL数据库插入时间类型Date数据时需要注意的问题
  4. 《ASCE1885的信息安全》の使用Crypto++的MD5算法对字符串进行哈希
  5. android doc例程---Notepad Tutorial学习要点!
  6. C语言实用算法系列之strtok字符串分割、strcat字符串拼接、strcpy、strcmp
  7. Hystrix 简介和使用
  8. 中国IT行业薪资:与销售相比,程序员真得很“穷”
  9. 6个工具让网页抓取变得轻而易举
  10. Pyhton词云示例(移植-情人节专用版)
  11. python柱状图纵轴刻度_Python数据分析:Matplotlib
  12. 微服务架构这马丁富勒的论文
  13. 已解决At least Windows 8.1 or Windows Server 2012 are required to install Python 3.9.4(64-bit)
  14. 【Python自动化Excel】pandas处理Excel的拆分、合并
  15. C# 使用ToolTip控件实现气泡消息提示
  16. java 常用英语单词
  17. 计算机网络CPT实验
  18. 【时序】TCCT:用于时间序列预测的紧耦合卷积 Transformer
  19. 目前的大数据,具体有哪些优势?
  20. 简书APP 使用产品报告

热门文章

  1. 美年大健康:健康大数据开放平台在路上
  2. 借助 Windows 事件转发进行入侵检测
  3. nacos: Error watching Nacos Service change
  4. 简化基因组的测序方法
  5. Java调用第三方接口示范
  6. ssl证书的注册与nginx的配置
  7. 基于javaweb jsp+SSM 甜品店系统的设计与实现
  8. 数创新生态 智启新未来,2023鼎桥全球生态大会圆满举办
  9. 微信小程序框架(二)-全面详解(学习总结---从入门到深化)
  10. 基于阿童木的MCA来了