Languages
[Edit]
EN

Intellij - fix for Error running unit tests. Command line is too long. Shorten the command line via JAR manifest or via a classpath file and rerun.

3 points
Created by:
Lia-Perez
565

Problem

I downloaded some project from github, imported it using maven and got an error when I tried run unit test.

Error message:

Error running UserRepositoryTest.someTest. Command line is too long. 
Shorten the command line via JAR manifest or via a classpath file and rerun.

Error screenshot: 

Solution

To solve the problem we need to change Shorten command line option to JAR manifest - java-cp classpath.jar className [args], the default one is: none - java [options] className [args].

 

Steps:

  1. Edit configuration of the test.
  2. Click on 'Modify options' and select 'Shorten command line'.
  3. Select JAR manifest - java-cp classpath.jar className [args] from Shorten command line options.
  4. Run the test again with success.

 

The same solution with screenshot steps.

 

Step 1

Edit configuration of the test.

 

Step 2

Click on 'Modify options' and select 'Shorten command line'.

 

 

Step 3

Select JAR manifest - java-cp classpath.jar className [args] from Shorten command line options.

 

Step 4

Run the test again with success.

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join