IDEA 10.5 Command line is too long

2019-02-12 16:56发布

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

set .iws

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

How this could be fixed?

2条回答
叛逆
2楼-- · 2019-02-12 17:38

See What does the dynamic.classpath flag do? (IntelliJ project settings).

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.

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.

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.

查看更多
疯言疯语
3楼-- · 2019-02-12 17:52

In Intellij, go to "edit configurations", in the configuration tab that comes up in the line "shorten command line" select option "classpath file", last option in the drop down menu. Fixed it for me

查看更多
登录 后发表回答