Createprocess Error=206, the Filename or Extension Is Too Long When Running Main() Method

CreateProcess error=206, The filename or extension is too long when running main() method

There is no simple (as in a couple of clicks or a simple command) solution to this issue.

Quoting from some answers in this bug report in Eclipse.org, these are the work-arounds. Pick the one that's the least painful to you:

  • Reduce the classpath
  • Use directories instead of jar files
  • Use a packed jar files which contains all other jars, use the classpath variable inside the manifest file to point to the other jars
  • Use a special class loader which reads the classpath from a config file
  • Try to use one of the attached patches in the bug report document
  • Use an own wrapper e.g. ant

Update: After July 2014, there is a better way (thanks to @Brad-Mace's answer below:

If you have created your own build file instead of using Project -> Generate Javadocs, then you can add useexternalfile="yes" to the Javadoc task, which is designed specifically to solve this problem.

CreateProcess error=206 The filename or extension is too long

In addition to changing the run configuration, you must also enable this in your workspace. It's quite silly that this is still required, and not enabled by default.

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" />

Android Studio 3.1.1 CreateProcess error=206, The filename or extension is too long

I guess you are the windows user, there is a file path limit of 8191 in Windows XP and above.

http://support.microsoft.com/kb/830473/en-us

The simplest way this shorten the file path, like change the project folder into D:\, and refact your project path, and always use ASCII chars for the folder name. UTF-8 chars use 2-3 bytes.
or move useless dependency.
or change to MAC platform. ;)

The reason is at the compile step, there is a command like javac xxxx, combine all dependences's path in one line.

Createprocess error=206; the filename or extension is too long

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>


Related Topics



Leave a reply



Submit