Createprocess error=206; the filename or extension is too long [duplicate]
Asked Answered
I

2

11

I know this question has been asked before, but I wasn't able to fix it using solutions from other posts. I'm trying to compile a complex hierarchy of gwt projects using maven. Everything worked fine until I had to add one more library, more specifically: org.eclipse.birt.runtime

Now I get this error:

[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.6.1:debug ....

..... [Lots of jars, many containing birt, no duplicates though] .....


Error while executing process. Cannot run program "C:\Program Files\Java\jdk1.8.0_20\jre\bin\java": CreateProcess error=206, The filename or extension is too long

The dependency I'm using is:

<dependency>
    <groupId>org.eclipse.birt.runtime</groupId>
    <artifactId>org.eclipse.birt.runtime</artifactId>
    <version>4.4.1</version>
</dependency>
Impasto answered 4/11, 2014 at 8:42 Comment(2)
Is Birt used in GWT client-side code? If not, then refactor your project to separate client-side and server-side code into distinct modules; otherwise then, well, don't use Windows?Snout
nope, it's only server side; client-side and server-side are already separated, what do you mean exactly?Impasto
I
9

I finally managed to solve it:

Turns out birt, together with its dependencies, was simply adding too many libraries and the classpath became too long for windows command to handle. Furthermore, birt libraries have stupidly long names.

Solved it using this dependency (I only needed the runtime), I created the lib and birt directories and placed the jar there myself:

<dependency>
    <groupId>org.eclipse.birt.runtime</groupId>
    <artifactId>org.eclipse.birt.runtime</artifactId>
    <version>4.4.1</version>
    <scope>system</scope>
    <systemPath>${basedir}/lib/birt/birt.runtime-4.4.1.jar</systemPath>
</dependency>
Impasto answered 5/11, 2014 at 11:28 Comment(2)
You should mark this answer as accepted, so other will more easily be made aware that you are no longer searching for a solution.Unwind
In 19 hours from now I'll be able to do this.Impasto
S
0

Birt has no reason to be in the classpath if it's not used client-side.

Unfortunately, Maven sometimes makes things harder than necessary; so with Maven you need your GWT client code to be a specific Maven module with no dependency on server-side code; then "merge" everything into a single WAR using WAR overlays.

With that layout (let's call the modules app-client and app-server), you have several solutions to launch gwt:run or gwt:debug:

  • never tried but you could probably configure hostedWebapp to point to your app-server output directory:

    <hostedWebapp>../app-server/target/app-server-${project.version}/</hostedWebapp>
    

    Make sure you run mvn clean before packaging your app-server WAR though to be sure the generated JS files come from app-client (as a WAR overlay) and not app-server (generated by gwt:run)

  • what I use in gwt-maven-archetypes: launch the server-side code in a distinct servlet container, and use <noServer>true</noServer>

    Make sure you run mvn clean before packaging too, or use -Dgwt.compiler.force, to be sure gwt:compile won't treat the DevMode-generated *.nocache.js file as up-to-date and will recompile the application.

Snout answered 4/11, 2014 at 10:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.