title: Cannot run program, error=7, Argument list too long
body: <p>I faced error while running unit test in intellij. Below is error message.</p>
  
  <p><strong>Error</strong></p>
  
  <blockquote>
    <p>Error running CLASS_NAME.TEST_METHOD_NAME: Cannot run program
    "JAVA_PATH/bin/java" (in directory "WORKSPACE_PATH"): error=7,
    Argument list too long</p>
  </blockquote>
  
  <p><strong>Below is the resolution, I found on SO -</strong></p>
  
  <p>Set <code>dynamic.classpath</code> (property present in workspace.xml) to <code>true</code>. </p>
  
  <p><strong>Negative-effects -</strong></p>
  
  <p>But because of above resolution, other unit tests are failing now.</p>
  
  <p>Reason - it is not loading other dependent module classpaths.</p>
  
  <p>These are the links related to this problem - <a href="https://stackoverflow.com/questions/4853540/what-does-the-dynamic-classpath-flag-do-intellij-project-settings">link1</a>, <a href="https://youtrack.jetbrains.com/issue/IDEA-130440" rel="noreferrer">link2</a></p>
  
  <p><strong>If anyone have any solution/workaround for this, please help me.</strong></p>