IDEA 10.5命令行太长 [英] IDEA 10.5 Command line is too long
问题描述
maven项目,windows,当我运行testcase时:
运行TestApp.readParameter时出错:命令行太长。为了减少其长度,可以使用classpath文件。是否要为项目的所有运行配置启用类路径文件模式?启用
maven project,windows,when i run testcase: Error running TestApp.readParameter: Command line is too long. In order to reduce its length classpath file can be used. Would you like to enable classpath file mode for all run configurations of your project? Enable
设置.iws
<property name="dynamic.classpath" value="true" />
如何解决这个问题?
推荐答案
请参阅什么dynamic.classpath标志有用吗? (IntelliJ项目设置)。
不确定要修复的内容。如果您需要避免动态类路径,请修改您的依赖项,将库,项目文件和JDK移动到具有短路径的目录。
Not sure what you want to fix. If you need to avoid dynamic classpath, revise your dependencies, move libraries, project files and JDK to a directory with short path.
编辑:您在注释中链接的错误是有道理的,但是,即使使用动态类路径,运行测试时命令行也会超出操作系统限制。这可能是因为IDEA无法缩短许多命令行参数或选项,因为IDEA只能解决长类路径问题。我们无能为力,您应该修改将参数传递给应用程序的方式,以便命令行长度在限制范围内。
Edit: the bug you linked in comments makes sense, however what happens is that the command line when running your tests exceeds the OS limit even when using dynamic classpath. This can happen because of lots of command line arguments or options which cannot be shortened by IDEA, as IDEA can only workaround long classpath issue. There is nothing we can do about it, you should revise the way you pass parameters to your app so that the command line length is within limits.
从IDEA方面,我们会改善这种案件的处理方式。当已经使用动态类路径时,将不再显示此对话框,您将收到有关长命令行的另一条错误消息。我为这个案例提交了一个新问题。
From the IDEA side, we'll improve the handling of such case. This dialog will no longer be displayed when dynamic classpath is already used and you will get another error message about the long command line. I've submitted a new issue for this case.
这篇关于IDEA 10.5命令行太长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!