Maven Compiler Plugin
  1. Maven Compiler Plugin
  2. MCOMPILER-68

Command line is too long, java.IO.Exception

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Win XP SP2
    • Number of attachments :
      0

      Description

      Hi there,

      i have the same problem again, like in ticket MCOMPILER-22. I am using maven in version 2.0.8.

      [java] Caused by: java.io.IOException: CreateProcess: C:\Programme\Java\jdk
      1.5.0_09\jre\bin\java.exe -Djava.awt.headless=true -classpath "C:\Dokumente und
      Einstellungen\david.heimann\.m2\repository\ant\ant-launcher\1.6.5\ant-launcher-1
      .6.5.jar;C:\Dokumente und Einstellungen\david.heimann\.m2\repository\ant\ant\1.6
      .5\ant-1.6.5.jar;C:\Dokumente und Einstellungen\david.heimann\.m2\repository\ant
      lr\antlr\2.7.6\antlr-2.7.6-sources.jar;C:\Dokumente und Einstellungen\david.heim
      ann\.m2\repository\antlr\antlr\2.7.6\antlr-2.7.6.jar;C:\Dokumente und Einstellun
      gen\david.heimann\.m2\repository\asm\asm-attrs\1.5.3\asm-attrs-1.5.3.jar;C:\Doku
      mente und Einstellungen\david.heimann\.m2\repository\asm\asm-commons\2.2.1\asm-c
      ommons-2.2.1.jar;C:\Dokumente und Einstellungen\david.heimann\.m2\repository\asm
      \asm\1.5.3\asm-1.5.3.jar;C:\Dokumente und Einstellungen\david.heimann\.m2\reposi
      tory\asm\asm\2.2.1\asm-2.2.1.jar;C:\Dokumente und Einstellungen\david.heimann\.m
      2\repository\asm\asm\3.0\asm-3.0.jar;C:\Dokumente und Einstellungen\david.heiman
      n\.m2\repository\aspectj\aspö
      [java] at java.lang.ProcessImpl.create(Native Method)
      [java] at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
      [java] at java.lang.ProcessImpl.start(ProcessImpl.java:30)
      [java] at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
      [java] at java.lang.Runtime.exec(Runtime.java:591)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
      sorImpl.java:39)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
      hodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:585)
      [java] at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.e
      xec(Execute.java:834)
      [java] at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:435
      )
      [java] at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:44
      9)
      [java] at org.apache.tools.ant.taskdefs.Java.fork(Java.java:751)
      [java] ... 25 more
      ----------------

      I have a ant-task in the pom.xml creating that long command. For a solution for this i would be very thankful. Sorry for my bad english...

        Activity

        Hide
        geoff simpson added a comment -

        I've got a similar issue but the error returned is different, but mine is caused by the classpath being too long. I guess the compiler should be using the java API to access the compiler options via tools.jar rather than using the command line.

        Show
        geoff simpson added a comment - I've got a similar issue but the error returned is different, but mine is caused by the classpath being too long. I guess the compiler should be using the java API to access the compiler options via tools.jar rather than using the command line.
        Hide
        Benjamin Bentmann added a comment -

        I have a ant-task in the pom.xml creating that long command.

        Why Ant, what is your special use case to not use the Maven Compiler Plugin? Could you please attach your pom.xml. Also, please don't post long log output into your description, it's hardly readable, especially with the artificial line breaks. On Windows, simply run

        mvn compile -X > build.log
        

        and attach the resulting log file to the issue.

        Show
        Benjamin Bentmann added a comment - I have a ant-task in the pom.xml creating that long command. Why Ant, what is your special use case to not use the Maven Compiler Plugin? Could you please attach your pom.xml . Also, please don't post long log output into your description, it's hardly readable, especially with the artificial line breaks. On Windows, simply run mvn compile -X > build.log and attach the resulting log file to the issue.
        Hide
        Benjamin Bentmann added a comment -

        I guess the compiler should be using the java API to access the compiler options via tools.jar rather than using the command line.

        Both the Maven Compiler Plugin and the Ant task have an option named fork exactly for this purpose.

        Show
        Benjamin Bentmann added a comment - I guess the compiler should be using the java API to access the compiler options via tools.jar rather than using the command line. Both the Maven Compiler Plugin and the Ant task have an option named fork exactly for this purpose.
        Hide
        geoff simpson added a comment -

        setting <fork>true</fork> has fixed my compile error. thanks for the tip.

        Show
        geoff simpson added a comment - setting <fork>true</fork> has fixed my compile error. thanks for the tip.

          People

          • Assignee:
            Olivier Lamy
            Reporter:
            David Heimann
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: