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.
https://blog.jetbrains.com/idea/2017/10/intellij-idea-2017-3-eap-configurable-command-line-shortener-and-more/
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.
Go to Run -> Edit Configuration... -> Change Shorten Command Line to JAR manifest.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With