IDEA 10.5 Command line is too long

前端 未结 5 463
感情败类
感情败类 2020-12-08 12:53

maven project,windows,when i run testcase: Error running TestApp.readParameter: Command line is too long. In order to reduce its length classpath file can be used. Would you

相关标签:
5条回答
  • 2020-12-08 13:37

    In Intellij, go to "edit configurations" (at the top of the main window), in the configuration tab that comes up in the line "shorten command line" select option "classpath file"/"@argFiles (Java 9+)", last option in the drop down menu. Fixed it for me.

    0 讨论(0)
  • 2020-12-08 13:37

    Open the file .idea/workspace.xml file from your project root folder, go to section

    <component name="PropertiesComponent">
    

    and add the following:

    <property name="dynamic.classpath" value="true" />
    
    0 讨论(0)
  • 2020-12-08 13:42

    Setting the Shorten command line:JAR manifest in Run/Debug Configurations resolves the issue.

    0 讨论(0)
  • 2020-12-08 13:53

    I had this problem using the community version. I managed the problem by running the project with the Maven configuration.

    spring-boot:run -Dspring.profiles.active=local
    

    Intellij Maven Configuration

    0 讨论(0)
  • 2020-12-08 13:54

    See What does the dynamic.classpath flag do? (IntelliJ project settings).

    Not sure what you want to fix. If you need to avoid dynamic classpath, revise your dependencies, move libraries, project files and JDK to a directory with short path.

    Edit: the bug you linked in comments makes sense, however what happens is that the command line when running your tests exceeds the OS limit even when using dynamic classpath. This can happen because of lots of command line arguments or options which cannot be shortened by IDEA, as IDEA can only workaround long classpath issue. There is nothing we can do about it, you should revise the way you pass parameters to your app so that the command line length is within limits.

    From the IDEA side, we'll improve the handling of such case. This dialog will no longer be displayed when dynamic classpath is already used and you will get another error message about the long command line. I've submitted a new issue for this case.

    0 讨论(0)
提交回复
热议问题