Eclipse/JUnit: CreateProcess error=206, The filename or extension is too long

If you encounter problems with running junit test in Eclipse and you get following exception:

Exception occurred executing command line.
Cannot run program "C:\Program Files\Java\jdk1.7.0\bin\javaw.exe" (in directory "C:\......"):
CreateProcess error=206, The filename or extension is too long

please download patch for Eclipse.

For Eclipse Juno and newer:
https://bugs.eclipse.org/bugs/attachment.cgi?id=216593
For older Eclipse:
https://bugs.eclipse.org/bugs/attachment.cgi?id=219900

After download back up existing eclipse/plugins/org.eclipse.jdt.launching_3.*.jar
Copy and paste classes in the patch to org.eclipse.jdt.launching JAR (replace existing files).
Restart Eclipse.

For me it worked.

In bug report Bug 327193 it is considered fixed, but it happen to me recently with Eclipse Kepler 4.3.2.

  • annaop

    I would suggest you usin Long Path Tool to eliminate this issue in other ocassions.

    • http://coffeedriven.org/ Maciej Dzikowicki

      Thanks for suggestion. I will try it

      • Raphadareangel Dareangel

        Could you give me an example to use this passing flom classpath from eclipse with this

      • Raphadareangel Dareangel

        I apply this patch and it doesn’t work I’m using a private platform base on eclipse

    • bonnie1202

      The Long Path Tool worked for me too actually! It’s great for this kind of issues :)

  • http://coffeedriven.org/ Maciej Dzikowicki

    Thanks for suggestion. I will try it next time

  • davehu

    I am using Long Path Tool software for such errors, and it works like charm.

    • John Raf

      “Long Path Tool” is very helpful for this error !
      You can use to solve this problem

  • eden

    Long path Tool is the best tool to solve the problem if File name or extension is long.

  • Arif Hussain

    plz try Long path Tool.

  • webb123

    Use “long path tool”, it is very helpful and easy to solve the problems like deleting, renaming the file. Try it and it gives good result…..

  • Ronald Carl

    yep I tried the long path tool it worked wonders for me.

  • wright sanches

    Long Path tool is a great tool for fixing problem.