IntelliJ IDEA: Fix “Command line is too long” when running tests
I could run my integration tests from the command line using mvn test without any issues.
IntelliJ IDEA: Fix “Command line is too long” when running tests
I could run my integration tests from the command line using mvn test without any issues.
However, when I tried to run the same tests from IntelliJ IDEA, I hit this error:
Command line is too long.
After googling a bit I found how I can solve this problem. You can do the fix in 2 possible ways: from the UI or by editing the config file directly.
Option 1. Edit the config file
Open the .idea/workspace.xml file and locate your <configuration> block.
Inside it, add one of the following options:
<shortenClasspath name=”ARGS_FILE” />
or:
<shortenClasspath name=”MANIFEST” />
Option 2. Configure it via the UI
Alternatively, you can configure the same thing from the UI: you can click on the configuration in the top right corner, click on the button “Edit Configurations…”, then find “Modify Options”, and enable “Shorten command line…”. After this a “Shorten command line” dropdown list appears. Select @argfile (Java 9+ or JAR manifest in there.

That’s it - your tests should now run in IntelliJ just like they do from the command line.
메타데이터
- post_id
- 4f175aaa1cd5
- slug
- intellij-idea-fix-command-line-is-too-long-when-running-tests-4f175aaa1cd5
- url
- https://medium.com/@roughterr/intellij-idea-fix-command-line-is-too-long-when-running-tests-4f175aaa1cd5
- canonical_url
- https://medium.com/@roughterr/intellij-idea-fix-command-line-is-too-long-when-running-tests-4f175aaa1cd5
- author_url
- https://medium.com/@roughterr
- status
- ok
- fetched_at
- 2026-06-24 13:29:15