I faced error while running unit test in intellij. Below is error message.
Error
Error running CLASS_NAME.TEST_METHOD_NAME: Cannot run program "JAVA_PATH/bin/java" (in directory "WORKSPACE_PATH"): error=7, Argument list too long
Below is the resolution, I found on SO -
Set dynamic.classpath
(property present in workspace.xml) to true
.
Negative-effects -
But because of above resolution, other unit tests are failing now.
Reason - it is not loading other dependent module classpaths.
These are the links related to this problem - link1, link2
If anyone have any solution/workaround for this, please help me.
looks like in modern variants of intellij you can select to put your path into a file or similar, this prevents expansion of your path to insane length.
Thus changing the "shorten command line" parameter to JAR Manifest should fix the issue.