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 longxxxxxxxxxxxx。


解决方案:

1.
在这里插入图片描述
如上图: 打开IDEA,找到项目最上部的 .idea ----- 双击打开 ----- 找到 workspace.xml ---- 双击打开该文件

2.
在这里插入图片描述
如上图,在 workspace.xml 文件中搜索:

<component name="PropertiesComponent">

在这块配置中加上一条:

<property name="dynamic.classpath" value="true" />

重新启动便可正常运行。


原因解释:

这到底是为什么呐?!

有位叫 仇聘发栖 的大佬是这样说的:

此选项控制类路径如何传递到JVM:通过命令行或通过文件。大多数操作系统都有最大的命令行限制,当超过时,IDEA将无法运行您的应用程序。 当命令行长于32768个字符时,IDEA建议您切换到动态类路径。将长类路径写入文件,然后由应用程序启动程序读取并通过系统类加载器加载。 如果您对实施细节感兴趣,可以查看IDEA社区版源代码,JdkUtil.java文件,

setupJVMCommandLine

方法。

Guess you like

Origin blog.csdn.net/weixin_44958006/article/details/121344934